Compare text non-case sensitive

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Sasi Rekha
    New Member
    • Aug 2007
    • 18

    Compare text non-case sensitive

    Hi I have Chennai in a textbox and CHENnai in my drop down. When i try to compare those two they are not matching. Is drop down values case sensitive? If so how can i make the drop down list values as case insensitive?

    Please respond to this query ASAP.

    Thanks.
  • dip_developer
    Recognized Expert Contributor
    • Aug 2006
    • 648

    #2
    Originally posted by Sasi Rekha
    Hi I have Chennai in a textbox and CHENnai in my drop down. When i try to compare those two they are not matching. Is drop down values case sensitive? If so how can i make the drop down list values as case insensitive?

    Please respond to this query ASAP.

    Thanks.
    Chennai and CHENnai are not same.....thats why they dont match.....whats wrong in it...??

    convert those to letters to Uppercase or Lowercase and then compare......
    Use ToLower() or ToUpper() method of String class for that.....

    Comment

    • Shashi Sadasivan
      Recognized Expert Top Contributor
      • Aug 2007
      • 1435

      #3
      are you using the Equals method of the string class?
      see its overloaded methods

      you can try something like this which will be true

      [CODE=cpp]string s = "hello";
      s.Equals("Hello ", StringCompariso n.OrdinalIgnore Case);[/CODE]

      Comment

      Working...