Here you can find the source of containsIgnoreCase(Collection
Parameter | Description |
---|---|
l | - collection of strings. |
s | - string item to see if exists in the collection. |
public static boolean containsIgnoreCase(Collection<String> l, String s)
//package com.java2s; /**/* w w w .ja v a 2 s.c o m*/ * Copyright 5AM Solutions Inc, ESAC, ScenPro & SAIC * * Distributed under the OSI-approved BSD 3-Clause License. * See http://ncip.github.com/caintegrator/LICENSE.txt for details. */ import java.util.Collection; import java.util.Iterator; public class Main { /** * Used to see if a Collection of strings contains a string, ignoring case. * @param l - collection of strings. * @param s - string item to see if exists in the collection. * @return true/false value. */ public static boolean containsIgnoreCase(Collection<String> l, String s) { Iterator<String> it = l.iterator(); while (it.hasNext()) { if (it.next().equalsIgnoreCase(s)) { return true; } } return false; } }