Here you can find the source of arrayContainsPartKey(String[] array, String key)
e.g.
Parameter | Description |
---|---|
array | Array to be scanned |
key | key |
public static boolean arrayContainsPartKey(String[] array, String key)
//package com.java2s; //License from project: LGPL public class Main { /**//from w w w .ja v a2 s . c o m * Method to find if the given key is part of any of the array values * <p> * e.g. if array contains <i>"abc"</i> and given key is <i>"abcdef"</i>; true is returned * </p> * * @param array * Array to be scanned * @param key * key * @return boolean true if partial key is found */ public static boolean arrayContainsPartKey(String[] array, String key) { for (String string : array) { if (key.indexOf(string) != -1) { return true; } } return false; } }