Java Question

Results 1 to 3 of 3

Thread: Java Question

  1. #1
    Richard R Guest

    Default Java Question

    I&#039;m trying to learn Java to integrate with all my ASP projects. I&#039;m going through a book, and someone please tell me why this doesn&#039;t work!!!! <BR><BR>String a = "test";<BR>String b = "TEST";<BR>String position = "";<BR><BR>if (b.toLowerCase() == a)<BR>{<BR>position = "pass";<BR>}<BR>else<BR>{<BR>position = "fail";<BR>}<BR><BR>position is coming up fail! Somebody please help me. If I make both strings the same case, it works. I want to try and work it so case does not matter.<BR><BR>All help is appreciated!

  2. #2
    java guru Guest

    Default try this

    if (java != ASP) {<BR> you.findNewDiscussionBoard();<BR> me.stopWastingMyTime();<BR>}

  3. #3
    Join Date
    Dec 1969

    Default RE: Java Question

    Java treats strings differently than JavaScript. Try:<BR><BR>if (b.equalsIgnoreCase(a))<BR><BR>will get you through it.

Posting Permissions

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