Jun 16, 2011 at 8:19pm
is there any stl containers which will return the number of multiple occurence of a word in a string ??
example :
line : hello world hello hello
word : hello
output : 3
thanks in advance :)
Jun 16, 2011 at 8:43pm
No, however there are functions that can fetch the sub-string of a string. Using those functions, you can figure out how many sub-strings there are.
http://cplusplus.com/reference/string/string/find/