This function will return a copy of a given string with everything but its letters and digits removed, which means it can be used to remove any unwanted characters (like "#" or "?") from, for example, a login name or a password.
NOTE: This function only returns the 26 letter English alphabet from A - Z (upper or lower case) and the numbers 0 - 9.
string_lettersdigits(string);
Argument | Description |
---|---|
string | The string to convert to letters and digits. |
String
if string_length(password) >
string_length(string_lettersdigits(password))
{
draw_text(32,32,"Invalid Password! Only Letters
and numbers please!");
}
The above code will check the length of a string against the length of the same string, but with all symbols removed. If they are not the same a message is drawn on the screen.