
please wait
tolower('A') == 'a'
|
|
tolower() returns a lower-case version of a char you put into it, or the same character if that doesn't apply. tolower('A') == 'a' isalpha() returns true if the character passed is a alphabetical, and false otherwise. 1 2 isalpha('d') == true isalpha('2') == false |
Actually, inputting numbers as a string is usually fine (unless it's a string that has to follow specific semantics). Inputtings NaN characters for number input is worse. |
I wanted to know if there is any way I can pass a whole string through tolower, using the string name, I tried various forms of tolower(StringTemp) & isalpha(StringTemp) but they came up with a build error every time. |
I didn't entirely mean errors due to coding issues, this particular program uses user input to navigate to different parts of the program, and passing numbers through where they should pass letters has very odd effects, in respect to where they end up. |
[quote]I didn't entirely mean errors due to coding issues, this particular program uses user input to navigate to different parts of the program, and passing numbers through where they should pass letters has very odd effects, in respect to where they end up. |
|
|
Iterate over your string and set each character to it's lowercase variant if it's a letter, and if you don't want numbers, throw an error if that character is a digit. |
|
|