count number of letters in string until delimiters c++ code example Example: count a character in a string c++ count(str.begin(), str.end(), 'e')