My IsLowercase() helper function. Do I need to treat \0 and spaces?

bool FBullCowGame::IsLowercase(FString Word) const

{
//treat \0 and spaces

for (auto Letter : Word) // loop for all the letters of the word
{
	if (!islower(Letter)) // if the letter is not lowercase
	{
		return false;  //set value of IsLowercase to false
	}
}
//return true;

}

Not really because islower is guaranteed that iscntrl, isdigit, ispunct, and isspace will return false.

1 Like

Privacy & Terms