public final class StringUtils extends Object
Modifier and Type | Method and Description |
---|---|
static boolean |
isValidEmail(String text)
Returns whether a string is a valid email address.
|
static String |
trimCharacters(String text,
char[] characters)
Trim the supplied characters from the start and end of the input text.
|
static String |
trimCharacters(String text,
char[] characters,
boolean trimWhiteSpace)
Trim the supplied characters from the start and end of the input text.
|
static String |
trimCharacters(String text,
Set<Character> characters)
Trim the supplied characters from the start and end of the input text.
|
static String |
trimCharacters(String text,
Set<Character> characters,
boolean trimWhiteSpace)
Trim the supplied characters from the start and end of the input text.
|
static String |
truncate(String text,
int newLength)
Truncates the supplied characters to the given maximum length.
|
public static boolean isValidEmail(String text)
text
- The text to check.public static String trimCharacters(String text, char[] characters)
text
- The text to be trimmed.characters
- The characters to remove.public static String trimCharacters(String text, char[] characters, boolean trimWhiteSpace)
text
- The text to be trimmed.characters
- The characters to remove.trimWhiteSpace
- Trim white space in addition to the supplied characters. Similar to
calling String.trim()
public static String trimCharacters(String text, Set<Character> characters)
text
- The text to be trimmed.characters
- The characters to remove.public static String trimCharacters(String text, Set<Character> characters, boolean trimWhiteSpace)
text
- The text to be trimmed.characters
- The characters to remove.trimWhiteSpace
- Trim white space in addition to the supplied characters. Similar to
calling String.trim()
public static String truncate(String text, int newLength)
text
- the supplied text.newLength
- the new length. If string is shorter than the new length, the original string will be returned.Copyright © 2013-2018 INRIX, Inc. All Rights Reserved.