Kate Posted April 6, 2011 Posted April 6, 2011 So there's IsInt and IsNumber...I need IsChar or IsCharacter. Just trying to test if a variable is a character A-Z. Is there something I'm missing? Thanks, Kate
Kate Posted April 6, 2011 Author Posted April 6, 2011 StringIsAlNum StringIsAlpha WilliamAh! Thanks! I kept searching for "character" :/ Apparently my search-fu is weak today. Thanks again!
UEZ Posted April 6, 2011 Posted April 6, 2011 (edited) You can use this: ConsoleWrite("1: "& IsCharSet("1") & @CRLF) ConsoleWrite("A: "&IsCharSet("A") & @CRLF) ConsoleWrite("a: "&IsCharSet("a") & @CRLF) ConsoleWrite("A1: "&IsCharSet("A1") & @CRLF) ConsoleWrite("AA: "&IsCharSet("AA") & @CRLF) Func IsCharSet($in, $pattern = "(?i)[^A-Z]") If $in = "" Then Return SetError(1, 0, 0) ;input is empty Local $aRegEx = StringRegExp($in, $pattern, 3) If @error Then Return 1 Return 0 EndFunc It may be that there is a much easier way to check this which I don't have in mind currently. Br, UEZ Edited April 6, 2011 by UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now