Here you can find the source of find(String str, Set
public static boolean find(String str, Set<String> stop)
//package com.java2s; import java.util.Set; public class Main { public static boolean find(String str, Set<String> stop) { for (String st : stop) { if (str.contains(st)) return true; }/*w ww. j a v a 2 s .c o m*/ return false; } }