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 :
Refactoring the above methods and showing with the use:
private String[] languages = {"pt", "en", "es"}; private Integer indexOf(String[] arr, String str){ for (int i = 0; i < arr.length; i++) if(arr[i].equals(str)) return i; return -1; } indexOf(languages, "en")