Search code examples
c++stringlowercasealphanumeric

How to check if a string is all lowercase and alphanumerics?


Is there a method that checks for these cases? Or do I need to parse each letter in the string, and check if it's lower case (letter) and is a number/letter?


Solution

  • You can use islower(), isalnum() to check for those conditions for each character. There is no string-level function to do this, so you'll have to write your own.