Java List Contain containsIgnoreCase(String str, String... list)

Here you can find the source of containsIgnoreCase(String str, String... list)

Description

contains Ignore Case

License

Open Source License

Declaration

public static final boolean containsIgnoreCase(String str, String... list) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;

public class Main {
    public static final boolean containsIgnoreCase(String str, String... list) {
        if (list != null && list.length != 0) {
            for (String s : Arrays.asList(list)) {
                if (s != null && s.equalsIgnoreCase(str)) {
                    return true;
                }/*w  ww.j  a va  2s.  com*/
            }
        }
        return false;
    }

    public static final boolean containsIgnoreCase(ArrayList<String> list, String str) {
        if (list != null && !list.isEmpty()) {
            for (String s : new ArrayList<>(list)) {
                if (s != null && s.equalsIgnoreCase(str)) {
                    return true;
                }
            }
        }
        return false;
    }

    public static boolean containsIgnoreCase(Collection<String> list, String str) {
        if (list != null && !list.isEmpty()) {
            for (String s : new ArrayList<>(list)) {
                if (s != null && s.equalsIgnoreCase(str)) {
                    return true;
                }
            }
        }
        return false;
    }
}

Related

  1. containsIgnoreCase(final String string, final List list)
  2. containsIgnoreCase(List list, String strIn)
  3. containsIgnoreCase(List list, String findMe)
  4. containsIgnoreCase(List list, String s)
  5. containsIgnoreCase(List list, String soughtFor)
  6. containsInAnyOrder(final List test, final List control)
  7. containsIndex(int index, List objects)
  8. containsInEach(List first, List second)
  9. ContainsInList(String list, String value)