1

Is there an easier way to compare a large list of items?

view story
linux-howto

http://stackoverflow.com – I have an extremely long list of items (over 200) and a database that displays the list. I have an on click event that will compare that if the first item is an "apple" then when you click it, facts come up about an "apple". The problem is that this list isn't a SET list, meaning the the word "apple" could be in the 1st spot or it could be in the 18th spot. I started doing an if statement that compares like this: case 0: if (text.equals("apple")) { [show facts about apple] } else if (text.equals("orange")) { [show facts about orange] //this would continue on to compare the ENTIRE LIST (abo (HowTos)