Results 1 to 7 of 7

Thread: [RESOLVED] Quick help with detecting words.

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2009
    Location
    Missouri
    Posts
    770

    Resolved [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.?
    Rate my post if i helped you!


    Button Configuration Control For VB6 GetAsyncKeyState
    I'm the 7th best high school programmer in the nation!(according to SkillsUSA Nationals)(Used C#.Net)

  2. #2
    Next Of Kin baja_yu's Avatar
    Join Date
    Aug 2002
    Location
    /dev/root
    Posts
    5,989

    Re: Quick help with detecting words.

    If LCase$("HeLLO") = "hello" Then MsgBox "They are equal"

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2009
    Location
    Missouri
    Posts
    770

    Re: Quick help with detecting words.

    xD Seriously? Wow man. Thanks so much! XD That was easy. =D
    Rate my post if i helped you!


    Button Configuration Control For VB6 GetAsyncKeyState
    I'm the 7th best high school programmer in the nation!(according to SkillsUSA Nationals)(Used C#.Net)

  4. #4
    Next Of Kin baja_yu's Avatar
    Join Date
    Aug 2002
    Location
    /dev/root
    Posts
    5,989

    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.

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2009
    Location
    Missouri
    Posts
    770

    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?
    Rate my post if i helped you!


    Button Configuration Control For VB6 GetAsyncKeyState
    I'm the 7th best high school programmer in the nation!(according to SkillsUSA Nationals)(Used C#.Net)

  6. #6
    Next Of Kin baja_yu's Avatar
    Join Date
    Aug 2002
    Location
    /dev/root
    Posts
    5,989

    Re: [RESOLVED] Quick help with detecting words.

    Right. There's also the UCase function to convert everything to upper case.

  7. #7
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    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$.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width