public static boolean containsAny ( boolean _ignoreCase , String _str , String ... _args ) { if ( _str == null || _args == null || _args . length == 0 ) { return false ; } String heystack = _str ; if ( _ignoreCase ) { heystack = _str . toLowerCase ( ) ; } for ( String s : _args ) { String needle = _ignoreCase ? s . toLowerCase ( ) : s ; if ( heystack . contains ( needle ) ) { return true ; } } return false ; }
Checks if any of the given strings in _args is contained in _str .