Here you can find the source of contains(String str, List
public static String contains(String str, List<String> list)
//package com.java2s; //License from project: Open Source License import java.util.List; public class Main { public static String contains(String str, List<String> list) { for (String s : list) { if (str.indexOf(s) != -1) { return s; }/*ww w. ja va 2s . c om*/ } return null; } }