I wanted to know if there\'s a native method in array for Java to get the index of the table for a given value ?
Let\'s say my table contains these strings :
No built-in method. But you can implement one easily:
public static int getIndexOf(String[] strings, String item) { for (int i = 0; i < strings.length; i++) { if (item.equals(strings[i])) return i; } return -1; }