public class Strings extends Object
| Modifier and Type | Field and Description |
|---|---|
static Comparator<String> |
NATURAL_ORDER
Natural order for strings.
|
| Constructor and Description |
|---|
Strings() |
| Modifier and Type | Method and Description |
|---|---|
static String |
blankToNull(String s)
Apply a transform that will replace blank values with null.
|
static boolean |
isBlank(CharSequence s)
Verify that the string contains all blank characters or is null.
|
static String |
lowercase(String s,
Locale locale)
Apply a lowercase transform to the string.
|
static String |
ltrim(String s) |
static String |
maxLength(String s,
int length)
Apply a constraint over string length.
|
static String |
nullToBlank(String s)
Apply a transform that will replace null values with blank.
|
static String |
rtrim(String s)
Trim trailing spaces.
|
static String |
trim(String s)
Null-safe trim.
|
static String |
uppercase(String s,
Locale locale)
Apply an uppercase transform to the string.
|
public static final Comparator<String> NATURAL_ORDER
public static String trim(String s)
s - The String to trim.public static String rtrim(String s)
s - The String to trim.public static String ltrim(String s)
public static boolean isBlank(CharSequence s)
Examples of blank strings :
"", " ", null
public static String blankToNull(String s)
public static String nullToBlank(String s)
public static String maxLength(String s, int length)
public static String lowercase(String s, Locale locale)
locale - The locale to use in the transformation,Copyright © 2014. All rights reserved.