Here you can find the source of isIn(String name, String[] array)
Parameter | Description |
---|---|
name | The name to search for |
array | The array to search |
public static boolean isIn(String name, String[] array)
//package com.java2s; //License from project: LGPL import java.util.Arrays; public class Main { /**/*from ww w. ja v a2 s.c om*/ * Inspects the array to see if it contains the passed string. * @param name The name to search for * @param array The array to search * @return true if the array contains the passed string. */ public static boolean isIn(String name, String[] array) { if (array == null || name == null) return false; return Arrays.binarySearch(array, name) >= 0; } }