Here you can find the source of containsIgnoreCase(List
Parameter | Description |
---|---|
list | a parameter |
s | a parameter |
public static boolean containsIgnoreCase(List<String> list, String s)
//package com.java2s; //License from project: Apache License import java.util.List; public class Main { /**/* w w w.jav a 2s . co m*/ * Returns true if 's' contains 'searchFor', ignoring case. * @param s * @param searchFor * @return */ public static boolean containsIgnoreCase(String s, String searchFor) { return s.toLowerCase().contains(searchFor.toLowerCase()); } /** * Returns true if the passed list contains the passed String s, ignoring * case. * * @param list * @param s * @return */ public static boolean containsIgnoreCase(List<String> list, String s) { for (String string : list) { if (string.toLowerCase().equals(s.toLowerCase())) { return true; } } return false; } }