How would I extract an int from a string with no spaces.
for example
int main()
{
string x = "helloworld557";
//or
string y = "mynameistimmy4234";
}
whats the easiest way?
also I want to modify the string after the ints are out to be
x= "helloworld"
y= "mynameistimmy"
Thanks
I'd also suggest the boost lexical_cast<> www.boost.org
If every input has format "textnumber" and if the compiler supports C++11 sufficiently, then std::regex_match can split the string just fine.