String Stream in C++ to parse string of words & numbers
问题 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