Here you can find the source of containsIgnoreCase(Collection
Parameter | Description |
---|---|
c | Collection<String> |
s | String |
public static boolean containsIgnoreCase(Collection<String> c, String s)
//package com.java2s; import java.util.*; public class Main { /**/*from w w w .j ava 2s . co m*/ * Convenience method: a case-insensitive variant of Collection.contains * @param c Collection<String> * @param s String * @return true if s case-insensitively matches a string in c */ public static boolean containsIgnoreCase(Collection<String> c, String s) { for (String squote : c) { if (squote.equalsIgnoreCase(s)) return true; } return false; } }