Java tutorial
//package com.java2s; public class Main { public static boolean contains(String str, boolean in, String... strs) { for (String s : strs) { if (in) { if (s.contains(str)) return true; } else { if (str.contains(s)) return true; } } return false; } }