Here you can find the source of containsStringIgnoreCase(Collection strings, String toCheck)
Parameter | Description |
---|---|
strings | collection of strings |
toCheck | the one to be checked |
public static boolean containsStringIgnoreCase(Collection strings, String toCheck)
//package com.java2s; import java.util.*; public class Main { /**// w w w. ja v a 2 s . c o m * Check if the collection has toCheck str in it, ignoring case sensitivity * * @param strings collection of strings * @param toCheck the one to be checked * @return */ public static boolean containsStringIgnoreCase(Collection strings, String toCheck) { if (toCheck == null) { return false; } //TODO: Find better way of doing this comparison. for (Iterator it = strings.iterator(); it.hasNext();) { if (toCheck.equalsIgnoreCase((String) it.next())) { return true; } } return false; } }