public final class Strings
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static boolean |
containsAny(java.lang.CharSequence cs,
char[] searchChars)
Checks if the CharSequence contains any character in the given set of characters.
|
static boolean |
containsAny(java.lang.CharSequence cs,
java.lang.CharSequence searchChars)
Checks if the CharSequence contains any character in the given set of characters.
|
static int |
countMatches(java.lang.CharSequence str,
java.lang.CharSequence sub)
Counts how many times the substring appears in the larger string.
|
static boolean |
equalsAny(java.lang.CharSequence cs,
java.lang.CharSequence[] strs)
Checks if the CharSequence equals any character in the given set of characters.
|
static boolean |
isEmpty(java.lang.CharSequence cs)
Checks if a CharSequence is empty ("") or null.
|
public static boolean equalsAny(java.lang.CharSequence cs, java.lang.CharSequence[] strs)
cs
- the CharSequence to checkfirst
- the first CharSequencerest
- the rest CharSequencepublic static boolean containsAny(java.lang.CharSequence cs, java.lang.CharSequence searchChars)
cs
- the CharSequence to check, may be nullsearchChars
- the chars to search for, may be nulltrue
if any of the chars are found, false
if no match or null inputpublic static boolean containsAny(java.lang.CharSequence cs, char[] searchChars)
cs
- the CharSequence to check, may be nullsearchChars
- the chars to search for, may be nulltrue
if any of the chars are found, false
if no match or null inputpublic static boolean isEmpty(java.lang.CharSequence cs)
cs
- the CharSequence to check, may be nulltrue
if the CharSequence is empty or nullpublic static int countMatches(java.lang.CharSequence str, java.lang.CharSequence sub)
str
- the CharSequence to check, may be nullsub
- the substring to count, may be nullnull