• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Search a name in a list

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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,
 
Ranch Hand
Posts: 621
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
I love a woman who dresses in stainless steel ... and carries tiny ads:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic