[RESOLVED] Quick help with detecting words.
Okay. Using the Split() function, i got the words just fine. But instead of having to do a bunch of or statements, is there a way to ignore the capitilization? Like it would return true if Hello was spelled Hello, hEllo, heLlo, helLo, hellO, hello, HeLlO, etc.?
Re: Quick help with detecting words.
If LCase$("HeLLO") = "hello" Then MsgBox "They are equal"
Re: Quick help with detecting words.
xD Seriously? Wow man. Thanks so much! XD That was easy. =D
Re: [RESOLVED] Quick help with detecting words.
If you are using a Split then a For loop to go through the result, use it to convert the whole string to lower case before splitting it, so you dont have to call LCase in each iteration.
Re: [RESOLVED] Quick help with detecting words.
SO LCase$ makes everything lowercase? So if i displayed the text somewhere, if some of it was upper case, it would be lower case instead?
Re: [RESOLVED] Quick help with detecting words.
Right. There's also the UCase function to convert everything to upper case.
Re: [RESOLVED] Quick help with detecting words.
Another option is StrComp()
If StrComp("Hello","HELLO",vbTextCompare)=0 Then ' they are equal
The advantage is a bit faster, because you are not returning a string which is done with LCase$.