I want to know if a string has any digits, or if there are no digits. Is there a function that easily does this?
find_first_of is probably your best bet, but I've been playing around with iostream facets so here's an alternative:
if ( use_facet< ctype >( locale() ).scan_is( ctype::digit,
str.data(), str.data() + str.size() ) != str.data + str.size() )
Change string to wstring and char to wchar and you might theoretically have a chance at handling those weird fixed-width digits used in some Asian scripts.