Java tutorial
//package com.java2s; import java.util.ArrayList; public class Main { public static int indexOf(ArrayList<String> list, String value) { for (int i = 0; i < list.size(); i++) { String name = list.get(i); if (value.equals(name)) { return i; } } return -1; } }