I have string like this: '123plus43times7'
where numbers are followed by words from a dictionary.
I understand that I can extract int/numbers by using the >> operator:
StringStream >> number
I can get the number. However, the Stream still has the number in it. How do I remove the number when the length of number is unknown or should I find out length of number and then use str.substr() to create a new String Stream ? Any other better method for doing it using C++ STL String and SStream would be really appreciated.
std::atoi().stringand a>>to astringwill only stop on whitespace. It will grab your letters, your numbers and everything else that gets in it's way.