Android examples for java.lang:array
is String Contains one of the string from an array
import android.text.TextUtils; import java.io.UnsupportedEncodingException; import java.nio.charset.Charset; import java.text.DecimalFormat; import java.util.ArrayList; import java.util.regex.Matcher; import java.util.regex.Pattern; public class Main{ public static boolean isStringContains(String str, String[] containsStr) { boolean isContains = false; for (String strItem : containsStr) { if (!StringUtils.isNullOrEmpty(str) && str.contains(strItem)) { isContains = true;//from w w w . j ava 2 s. c o m return isContains; } } return isContains; } }