There may be a shiny UDF somewhere for this, REGEX would do it, and of course you could always do a char by char check... this is what I came up with first though...
Code:
$string="FOObar"
if lcase($string) == $string
? "Has Caps"
endif
[Edit... missed the output of FOO and BAR Requirements... sorry. Thinking again ]
"Upper case characters in string: '"+udfGetChars($sString,$sUCASE)+"'"+@CRLF "Lower case characters in string: '"+udfGetChars($sString,$sLCASE)+"'"+@CRLF "Alpha characters in string: '"+udfGetChars($sString,$sLCASE+$sUCASE)+"'"+@CRLF "Numeric characters in string: '"+udfGetChars($sString,$sNumerics)+"'"+@CRLF
Function udfGetChars($s,$sMatch) Dim $SO $udfGetChars="" $SO=SetOption("CaseSensitivity","ON") While $s<>"" If InStr($sMatch,Left($s,1)) $udfGetChars=$udfGetChars+Left($s,1) EndIf $s=SubStr($s,2) Loop $SO=SetOption("CaseSensitivity",$SO) EndFunction
Output:
Quote:
Upper case characters in string: 'FOO' Lower case characters in string: 'bar' Alpha characters in string: 'FOObar' Numeric characters in string: '123'
MartMart KiX Supporter
Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
Originally Posted By: Benny69
mine is Golfed and in pretty colors, so its better ....
Hmmmm.... hope your talking about the UDF if not then you should go and see a doctor
Thanks. I knew it had to be something easy. In the back of my mind I knew about the double = but just never did anything with it. After seeing the examples here it all came back. I really like Richards’ idea of a UDF to find certain characters. Thanks again.