Results 1 to 6 of 6

Thread: Uppercase and Lowercase regonised the as the same.

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2005
    Posts
    124

    Uppercase and Lowercase regonised the as the same.

    I want to be able to put in a word which can be either Title Case, Lower Case, Upper Case or whatever and still be recognised the same way when it is time compare the word to another.

    So in my program I have hard-coded Visual Basic and if a user types in ViSuAl BaSiC it will still match provided the spelling is the same, of course .I know the ToUpper() and ToLower() commands but I don't think they would be used in a soultion. Could someone please point me in the right direction? Thanks.
    I never know what to put in this section...



    So sue me... ... ... I'm just kidding...


    www.fat-pie.com Flash Movies... You gotta see 'em to believe 'em!

  2. #2
    Fanatic Member
    Join Date
    May 2005
    Posts
    898

    Re: Uppercase and Lowercase regonised the as the same.

    Please explain why you don't want to use the ToUpper() or ToLower() functions.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Mar 2005
    Posts
    124

    Re: Uppercase and Lowercase regonised the as the same.

    Oh, because I want the text to be compared to the hard coded text in the program without the user seeing it. Will ToUpper() and ToLower() convert a string before it is compared without changing anything in the textbox? I imagine it much as the CInt function. If it does then I will try implement a solution straight away, and I already know what code I can use.
    I never know what to put in this section...



    So sue me... ... ... I'm just kidding...


    www.fat-pie.com Flash Movies... You gotta see 'em to believe 'em!

  4. #4
    Fanatic Member
    Join Date
    May 2005
    Posts
    898

    Re: Uppercase and Lowercase regonised the as the same.

    VB Code:
    1. If MyTextBox.Text.ToLower().Equals("yomammaisaho") then
    2. '
    3. End If

    will not alter whatever is in the textbox, it will only return a lowcase string.

  5. #5
    Code Monkey wild_bill's Avatar
    Join Date
    Mar 2005
    Location
    Montana
    Posts
    2,993

    Re: Uppercase and Lowercase regonised the as the same.

    How about:
    [Highlight=VB]
    Const sHardCode as String = "VISUAL BASIC"
    ...
    If Textbox1.Text.ToUpper = sHardCode then
    ...

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Mar 2005
    Posts
    124

    Re: Uppercase and Lowercase regonised the as the same.

    yeah, thats exactly the code i was thinking of except the sHardCode part
    I never know what to put in this section...



    So sue me... ... ... I'm just kidding...


    www.fat-pie.com Flash Movies... You gotta see 'em to believe 'em!

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