String comparison

Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved

Join Date: Dec 2007
Posts: 28
Reputation: abhi287 is an unknown quantity at this point 
Solved Threads: 0
abhi287 abhi287 is offline Offline
Light Poster

String comparison

 
0
  #1
Apr 5th, 2008
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..
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 794
Reputation: darkagn has a spectacular aura about darkagn has a spectacular aura about darkagn has a spectacular aura about 
Solved Threads: 110
darkagn's Avatar
darkagn darkagn is offline Offline
Master Poster

Re: String comparison

 
0
  #2
Apr 5th, 2008
I don't think that's possible. You can check the String against each String in your array (which is what you've said you don't want to do?) but how does it make sense to compare a single string with an array of strings? When do you expect them to be equal?
There are no stupid questions, only those too stupid to ask for help.
echo is a web developer's best friend.
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 28
Reputation: abhi287 is an unknown quantity at this point 
Solved Threads: 0
abhi287 abhi287 is offline Offline
Light Poster

Re: String comparison

 
0
  #3
Apr 5th, 2008
I solved the problem using ArrayList

Anyway thanks..
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Java Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC