I have a string value, I also have an array of strings and an enum containing the range also. To get the index of the string in the array, from the value supplied I write th
I might not understand you question, but the same code works for enums too:
int index = Arrays.asList(YourEnum.values()).indexOf(YourEnum.ENUM_ITEM);
Or you can get:
int index = YourEnum.valueOf("ENUM_ITEM").ordinal();