Jump to content

check if a variable is a character


Recommended Posts

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 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!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...