number of multiple occurence of a word in a string

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 :)
closed account (S6k9GNh0)
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/
Topic archived. No new replies allowed.