DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR CPP
count occurrences of character in string c++
std::string s = "a_b_c"; size_t n = std::count(s.begin(), s.end(), '_'); // n=2
Source by stackoverflow.com #
PREVIOUS
NEXT
Tagged:
#count
#occurrences
#character
#string
ADD COMMENT
Topic
COMMENT
Name
1+8 =
Submit