Here you can find the source of inArray(String str, String[] stringArray)
public static boolean inArray(String str, String[] stringArray)
//package com.java2s; //License from project: Apache License public class Main { public static boolean inArray(String str, String[] stringArray, boolean caseInsensetive) { return getInArrayID(str, stringArray, caseInsensetive) >= 0; }//from www . j a va 2s .c o m public static boolean inArray(String str, String[] stringArray) { return inArray(str, stringArray, false); } public static boolean inArray(String str, String stringArray, String strsplit, boolean caseInsensetive) { return inArray(str, stringArray.split(strsplit), caseInsensetive); } public static boolean inArray(String str, String stringArray, String strsplit) { return inArray(str, stringArray.split(strsplit), false); } public static boolean inArray(String str, String stringArray) { return inArray(str, stringArray.split(","), false); } public static int getInArrayID(String strSearch, String[] stringArray, boolean caseInsensetive) { for (int i = 0; i < stringArray.length; i++) { if (caseInsensetive) { if (strSearch.toLowerCase().equals(stringArray[i].toLowerCase())) { return i; } } else { if (strSearch.equals(stringArray[i])) { return i; } } } return -1; } public static int getInArrayID(String strSearch, String[] stringArray) { return getInArrayID(strSearch, stringArray, true); } }