|
-
Nov 3rd, 2010, 09:17 PM
#1
Thread Starter
Fanatic Member
[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.?
-
Nov 3rd, 2010, 09:53 PM
#2
Re: Quick help with detecting words.
If LCase$("HeLLO") = "hello" Then MsgBox "They are equal"
-
Nov 3rd, 2010, 10:02 PM
#3
Thread Starter
Fanatic Member
Re: Quick help with detecting words.
xD Seriously? Wow man. Thanks so much! XD That was easy. =D
-
Nov 3rd, 2010, 10:06 PM
#4
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.
-
Nov 4th, 2010, 02:52 PM
#5
Thread Starter
Fanatic Member
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?
-
Nov 4th, 2010, 03:18 PM
#6
Re: [RESOLVED] Quick help with detecting words.
Right. There's also the UCase function to convert everything to upper case.
-
Nov 4th, 2010, 03:21 PM
#7
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$.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|