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

    Default String comparison


    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[]'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..


  2. #2
    Join Date
    Apr 2008
    Fort Wayne, Indiana
    Rep Power


    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
    Colombo, Sri Lanka
    Blog Entries
    Rep Power

Similar Threads

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