This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Java in General and the fly likes Search a name in a list Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Search a name in a list " Watch "Search a name in a list " New topic
Author

Search a name in a list

soma lingam
Greenhorn

Joined: Apr 26, 2007
Posts: 19
Hi Friends,

I have some problem regarding search the list of names the list will be like
ArrayList list = new ArrayList();
list.add("ARIGENTO");
list.add("ARIGENTO'");
list.add("CALTANA");
list.add("COFIRMACALTANA");
list.add("BIVONA");
list.add("ARAGONA");
list.add("S.ANNA CALTOVA");


I need to search the name like : %ANA

where % is a formality it has nothing to do but it should be the starting field
If i give the above search name where ever the names that are available in the list with these names should be copied in another arraylist
please, help me in this regard, give me a simple way to do not by any other big logic

Thanks,
dhwani mathur
Ranch Hand

Joined: May 08, 2007
Posts: 621
ok,why dont you try the method.

list.indexOf();
list.contains();


so as to get the particular element.Then according the index whatever it may be(0,1,2,3,4.......) get the elements from the list.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Search a name in a list
 
Similar Threads
How to maintain order in list
ArrayList, contains, objects
How to search a name in a group of list
Generics - need help
Subdividing a Collection into smaller collections