Java List Contain contains(final List list, final String str)

Here you can find the source of contains(final List list, final String str)

Description

contains

License

Open Source License

Declaration

public static boolean contains(final List<String> list, final String str) 

Method Source Code

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

import java.util.List;

public class Main {
    public static boolean contains(final List<String> list, final String str) {
        //Utility to check if given 'str' is present as substring in atleast one entry in the list.
        for (final String entry : list)
            if (entry.toLowerCase().contains(str.toLowerCase()))
                return true;
        return false;
    }// w w w. j a va2s  .  co m
}

Related

  1. addAllIfNotContained(List dst, Collection src)
  2. addIfNotContained(List list, Object object)
  3. contains(final List requested, final List claimed)
  4. contains(final List list, T value)
  5. contains(final String text, final List tokens)
  6. contains(final String[] list, final String value)