public class StringUtil
extends java.lang.Object
Constructor and Description |
---|
StringUtil() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
capitalize(java.lang.String string)
Capitalizes the first letter of every word of the given string.
|
static java.lang.String |
capitalizeFully(java.lang.String string)
Capitalizes the first letter of every word of the given string and decapitalizes all other letters.
|
static boolean |
contains(java.lang.String string,
java.lang.String... strings)
Tests whether a string contains any of the others.
|
static boolean |
equals(java.lang.String string,
java.lang.String... strings)
Tests whether a string equals any of the others.
|
static boolean |
equalsIgnoreCase(java.lang.String string,
java.lang.String... strings)
Tests whether a string equals any of the others, ignoring case considerations.
|
static boolean |
isNotBlank(java.lang.String string)
Indicates whether a string object (may be
null ) is blank or not. |
static java.lang.String |
join(char seperator,
java.lang.String... strings)
Joins an array of strings with a specified seperator.
|
static java.lang.String |
join(java.lang.String seperator,
java.lang.String... strings)
Joins an array of strings with a specified seperator.
|
static boolean |
startsWithIgnoreCase(java.lang.String string,
java.lang.String prefix)
Indicates whether a string starts with a given prefix ignoring the case.
|
public static boolean contains(java.lang.String string, java.lang.String... strings)
string
- the stringstrings
- the other stringstrue
if the string contains any of the otherspublic static boolean equals(java.lang.String string, java.lang.String... strings)
string
- the stringstrings
- the other stringstrue
if the string equals any of the otherspublic static boolean equalsIgnoreCase(java.lang.String string, java.lang.String... strings)
string
- the stringstrings
- the other stringstrue
if the string equals any of the others, ignoring case considerationspublic static java.lang.String join(char seperator, java.lang.String... strings)
seperator
- the seperatorstrings
- the stringspublic static java.lang.String join(java.lang.String seperator, java.lang.String... strings)
seperator
- the seperatorstrings
- the stringspublic static java.lang.String capitalize(java.lang.String string)
string
- string to capitalizepublic static java.lang.String capitalizeFully(java.lang.String string)
string
- string to capitalizepublic static boolean startsWithIgnoreCase(java.lang.String string, java.lang.String prefix)
string
- string to testprefix
- prefix to look fortrue
, if and only if the given string starts with the given prefix (ignoring case)public static boolean isNotBlank(java.lang.String string)
null
) is blank or not.string
- string to testtrue
, if and only if the given string is not null
and contains at least one non-whitespace character