I’d like to test a std::string for containing numbers of any range e.g 5 to 35 in a std::string s = "XDGHYH20YFYFFY" would there be function or I would have to convert a number to string and then use a loop to find each one?
I’d like to test a std::string for containing numbers of any range e.g 5
Share
I’d probably use a locale that treated everything except digits as white-space, and read the numbers from a stringstream imbued with that locale and check if they’re in range: