Java tutorial
//package com.java2s; import java.util.ArrayList; import java.util.Iterator; public class Main { public static int GetIndexFromCollection(ArrayList list, String value) { Iterator Item = list.iterator(); int index = -1; while (Item.hasNext()) { index++; if (Item.next().toString().equalsIgnoreCase(value)) return index; } return -1; } }