Results 1 to 3 of 3
  1. #1
    abhiN is offline Member
    Join Date
    Jan 2008
    Posts
    23
    Rep Power
    0

    Default String comparison

    Hi

    I m developing an application in which i want to compare a String with string[].

    Means i m having array of names which i m displaying in a table..Then i m changing some names in table dynamically by some processing and adding new names to the table...
    While replacing i want to check weather the new name is present in the array of previously added names... and if not present add it to table...

    Now if i used for loop and compare new name with names[] ..it'll compare only one name at a time..but i want to compare new name with total array...

    how can i do this..
    plz help..

    thnks..

  2. #2
    Join Date
    Apr 2008
    Location
    Fort Wayne, Indiana
    Posts
    62
    Rep Power
    0

    Default

    Unless I am mistaken, you wont be able to do this with an array unless you use the for loop method. Try using a List<String>. That will allow you to do a little more. Also look into HashMap. One of these should lead you to a solution.

  3. #3
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

Similar Threads

  1. Comparison of Strings
    By Cero.Uno in forum New To Java
    Replies: 3
    Last Post: 02-11-2008, 02:46 AM
  2. Date comparison
    By Rageagainst20 in forum New To Java
    Replies: 0
    Last Post: 12-19-2007, 06:34 PM
  3. Parsing Dates for Comparison
    By Rageagainst20 in forum New To Java
    Replies: 1
    Last Post: 12-19-2007, 05:50 AM
  4. String comparison
    By sireesha in forum New To Java
    Replies: 1
    Last Post: 12-18-2007, 12:16 AM
  5. Replies: 0
    Last Post: 11-20-2007, 04:59 PM

Posting Permissions

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