Java Collection Contain containsIgnoreCase(Collection c, String str)

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

Description

contains Ignore Case

License

Open Source License

Declaration

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

Method Source Code

//package com.java2s;
/*//from   w  ww .  j a va2 s.com
 * Copyright: (c) 2004-2010 Mayo Foundation for Medical Education and 
 * Research (MFMER). All rights reserved. MAYO, MAYO CLINIC, and the
 * triple-shield Mayo logo are trademarks and service marks of MFMER.
 *
 * Except as contained in the copyright notice above, or as used to identify 
 * MFMER as the author of this software, the trade names, trademarks, service
 * marks, or product names of the copyright holder shall not be used in
 * advertising, promotion or otherwise in connection with this software without
 * prior written authorization of the copyright holder.
 * 
 * Licensed under the Eclipse Public License, Version 1.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at 
 * 
 *       http://www.eclipse.org/legal/epl-v10.html
 * 
 */

import java.util.Collection;
import java.util.Iterator;

public class Main {
    public static boolean containsIgnoreCase(Collection<String> c,
            String str) {

        Iterator<String> it = c.iterator();
        while (it.hasNext()) {
            String temp = it.next();
            if (temp.equalsIgnoreCase(str)) {
                return true;
            }

        }
        return false;

    }
}

Related

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