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..

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?

I solved the problem using ArrayList

Anyway thanks..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.