Is there a similar function to indexof() that will search a string array (preferably unsorted) for a string and return it’s index? (or maybe ordinate value?)
for example i am trying:
String[] colours= {"Red", "Orange", "Yellow"};
System.out.println("indexOf(Red) = " +
colours.indexOf("Red"));
…but having no success.
thanks.
AV
p.s. this will eventually need to work in a 2d array (in case that matters)
OR
if order doesn’t matter then