public final class StringUtils
extends Object
Utility methods for when dealing with
Strings.
- Since:
- 4.5
- Author:
- Steven van Beelen
-
Method Summary
Return the given string, with its first character uppercase.
static boolean
Validate whether the given
String s is
null or not empty (where empty is defined as
"").
Return the given s, with its first character lowercase.
static boolean
Validate whether the given
String s not empty (where empty is defined as
"").
static boolean
Validate whether the given
String s is not
null and not empty (where empty is defined as
"").
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Method Details
-
nonEmptyOrNull
public static boolean nonEmptyOrNull(String s)
Validate whether the given
String s is not
null and not empty (where empty is defined as
"").
- Parameters:
s - the String to validate whether it is not null and not empty
- Returns:
true if the given String s is not null and not empty, false
otherwise
-
emptyOrNull
public static boolean emptyOrNull(String s)
Validate whether the given
String s is
null or not empty (where empty is defined as
"").
- Parameters:
s - The String to validate whether it is null or empty.
- Returns:
true if the given String s is not null and not empty, false
otherwise.
-
nonEmpty
public static boolean nonEmpty(String s)
Validate whether the given
String s not empty (where empty is defined as
"").
- Parameters:
s - the String to validate whether not empty
- Returns:
true if the given String s is not empty, false
otherwise
-
lowerCaseFirstCharacterOf
Return the given s, with its first character lowercase.
- Parameters:
s - The input string to adjust to a version with the first character as a lowercase.
- Returns:
- The input string, with first character lowercase.
-
capitalize
Return the given string, with its first character uppercase.
- Parameters:
string - The input string to adjust to a version with the first character as uppercase.
- Returns:
- The input string, with first character in uppercase.