Possible Duplicate:
Splitting a string in C++
In PHP, the explode() function will take a string and chop it up into an array separating each element by a specified delimiter.
Is there an equivalent function in C++?
I am quite familiar with sed on bash shell, so I do
cat $myfile | egrep $pattern | sed -e 's/$pattern/$replace/g'
a lot. Quite a few times, I find that I need to do similar kind of "string parsing" …
Consider:
$a = 'How are you?';
if ($a contains 'are')
echo 'true';
Suppose I have the code above, what is the correct way to write the statement if ($a contains 'are')?