• Post Reply Bookmark Topic Watch Topic
  • New Topic

Search a name in a list  RSS feed

 
soma lingam
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 621
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!