Java Collection Contain containsIgnoreCase(Collection c, String s)

Here you can find the source of containsIgnoreCase(Collection c, String s)

Description

Convenience method: a case-insensitive variant of Collection.contains

License

Open Source License

Parameter

Parameter Description
c Collection<String>
s String

Return

true if s case-insensitively matches a string in c

Declaration

public static boolean containsIgnoreCase(Collection<String> c, String s) 

Method Source Code

//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&lt;String&gt;
     * @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;
    }
}

Related

  1. containsClassOrSuper(Collection classNames, String className)
  2. containsElement(Collection collect, T elem)
  3. containsIdentity(Collection collection, T element)
  4. containsIdentity(Collection objects, Object object)
  5. containsIgnoreCase(Collection c, String s)
  6. containsIgnoreCase(Collection c, String str)
  7. containsIgnoreCase(Collection collection, String testString)
  8. containsIgnoreCase(Collection collection, String value)
  9. containsIgnoreCase(Collection l, String s)