how do I code to check if a string does not equal another string? a value?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Heyjude579
    New Member
    • Nov 2011
    • 2

    how do I code to check if a string does not equal another string? a value?

    I understand how to use the equals, and know that there is an option to use '!' for unequal check, but in my case, I am testing against a value in quotes. See my code below.... how do I use the '!' to check against a value in quotes? I also would like to change this test to a while loop, rather than an if/else. I am hoping this will still work in that case (??)

    if ("quit".equals( inputWord)) { // checks for string=quit.

    JK
  • Leen
    New Member
    • Aug 2010
    • 22

    #2
    try this please
    if (("quit".equals (inputWord)==fa lse)

    Comment

    Working...