Java Collection Contain stringContainsOneOfStringsFromCollection(final String pattern, final Collection collection)

Here you can find the source of stringContainsOneOfStringsFromCollection(final String pattern, final Collection collection)

Description

string Contains One Of Strings From Collection

License

Open Source License

Declaration

private static boolean stringContainsOneOfStringsFromCollection(final String pattern,
             final Collection<String> collection) 

Method Source Code


//package com.java2s;

import java.util.Collection;

public class Main {
    private static boolean stringContainsOneOfStringsFromCollection(final String pattern,
            final Collection<String> collection) {
        boolean result = false;

        for (final String string : collection) {
            if (pattern.contains(string)) {
                result = true;/*  w  ww  .ja v a  2  s  .  co  m*/
                break;
            }
        }

        return result;
    }
}

Related

  1. getContainmentRelation(Collection a, Collection b)
  2. intersect(Collection container, Collection contained)
  3. isAnyElementContains(String str, Collection col)
  4. isContained(Collection container, String strSearch)
  5. isNullOrContains(final Collection collection, final T item)