Case Sensitive

Results 1 to 4 of 4

Thread: Case Sensitive

  1. #1
    Rob Lovett Guest

    Default Case Sensitive

    I want to test two strings, which I can but i cannot gaurantee that they will be in the same case. I do not want to worry about this, so is there a way of comparing two string whose case may not be the same or do I have to stick with converting both strings first to either lower or upper case.<BR><BR>Thanks<BR>Rob

  2. #2
    Join Date
    Dec 1969

    Default RE: Case Sensitive

    Just do the comparison using either .toUpperCase or .toLowerCase:<BR><BR>if (string1.toUpperCase == string2.toUpperCase) {<BR>... code here<BR>}

  3. #3
    Rob Lovett Guest

    Default RE: Case Sensitive

    Thanks for confirming that for me.<BR><BR>I was hoping that there was something neater - never mind.<BR><BR>Rob

  4. #4
    neater? Guest

    Default RE: Case Sensitive

    you could use a case-insensitive regular expression<BR><BR>a javascript manual will have the works on this - it&#039;s possibly a bit much for a newsgroup post.<BR><BR>

Posting Permissions

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