I have done a bit of looking, but can't seem to find a way
to easily tell VBS to ignore the case of a string. For
example
I am comparing user defined strings with database records
and looking for a match. So if the DB record has 'Car' and
the user enters 'car' it will fail. My code for this looks
like this:
if U(1) = UserString then
'stuff
Where U(1) is a field in a record and UserString is the
value that the user supplied.
I am hoping to find a tool like this:
if U(1) = IgnoreCase(UserString) then
'stuff
Is there such a function? Sorry if this is obvious,
everything I found dealt with the RegExp object and I
don't want to use that for such a simple task.
Thanks in advance!
Steve
if ucase(strA) = ucase(strB) then
...
or use the StrComp() function...
StrComp Function
http://msdn.microsoft.com/scripting/vbscript/doc/vsfctStrComp.htm
--
Michael Harris
Microsoft.MVP.Scripting
--
mik...@mvps.org
Please do not email questions - post them to the newsgroup instead.
--
"Steve K" <r...@k2dis.com> wrote in message news:06e801c100f3$6aee9c80$b1e62ecf@tkmsftngxa04...
I was being lazy, if I had given it erious thought I would have thought to normalize. Thanks again and sorry for asking such a simple question, this is a good resource so I don't want to get marked as one of those guys that comes along and asks really dumb questions. ;)
Everything works great now-
Steve
PS> Have a good weekend
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
if UCase(U(1)) = UCase(UserString )
Paul
"Steve K" <r...@k2dis.com> wrote in message
news:06e801c100f3$6aee9c80$b1e62ecf@tkmsftngxa04...