• Post Reply Bookmark Topic Watch Topic
  • New Topic

Replace values with index  RSS feed

 
Thomas Greene
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an Arraylist which contains Strings.



Then there is a Java Bean defined as


There is an ArrayList of this bean which data such as


I want to iterate over items in the bean and replace them with index of items from the nodes array. For instance, values in the above bean needs to be changed to



Can someone please suggest how I should go about doing this? Thank you
 
Carey Brown
Saloon Keeper
Posts: 3329
46
Eclipse IDE Firefox Browser Java MySQL Database VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Look up the Javadoc for String.indexOf().
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!