Results 1 to 2 of 2
  1. #1
    Suzanne1187 is offline Member
    Join Date
    Feb 2009
    Rep Power

    Default Help on Java Input Case Insensitivity

    Thanks for reading my post.

    I need help with a project and i have a sample piece of the code pasted below.

    public String getGet (String want) {
    if (want.equals("Animal"))
    return "Dog";
    if (want.equals("Candy"))
    return "cookie";........

    I have a bunch of tests to run this as a junit test. However, I need help formatting this to allow my input to be case insensitive.

    ex. If i input "Animal" or "aNIMal" or "animal" or "AnImAl" I need to retrieve the associated output of "dog" no matter what letter is capital or lower case


  2. #2
    mtyoung is offline Senior Member
    Join Date
    Dec 2008
    Hong Kong
    Rep Power

Similar Threads

  1. String Title case
    By bugger in forum New To Java
    Replies: 6
    Last Post: 01-31-2012, 01:21 PM
  2. Switch Case and Key Events
    By AndrewM16921 in forum New To Java
    Replies: 4
    Last Post: 01-26-2009, 11:20 PM
  3. Is Java Case Sensitive???? Prove It
    By j2vdk in forum New To Java
    Replies: 53
    Last Post: 09-01-2008, 09:54 AM
  4. Replies: 2
    Last Post: 08-07-2007, 03:50 PM
  5. how to take input and verify input in Java programs
    By bilal_ali_java in forum Advanced Java
    Replies: 0
    Last Post: 07-21-2007, 08:46 AM

Posting Permissions

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