Here you can find the source of containsString(Collection
public static boolean containsString(Collection<String> coll, String str)
//package com.java2s; //License from project: Open Source License import java.util.Collection; public class Main { public static boolean containsString(Collection<String> coll, String str) { for (String s : coll) { if (s != null && s.contains(str)) return true; }/* w ww . j a v a2 s . c o m*/ return false; } }