java.lang.Object | |
↳ | com.neomades.util.StringUtils |
String Utilities.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
StringUtils() |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
static boolean |
isNullOrEmpty(String element)
Return true if the string is null or ""
| ||||||||||
static String |
neverEmpty(String element)
Converts "" to null
| ||||||||||
static String |
neverNull(String element)
Converts null element to empty string ""
| ||||||||||
static String |
replace(String original, String replaced, String by)
Replaces
replaced string occurrences from original
by the parameter by . | ||||||||||
static String |
replaceAll(String original, String replaced, String by)
Replaces
replaced string occurrences from original
that matches the given regular expression by . | ||||||||||
static String[] |
split(String string, String separator)
Splits a string into substrings, based on a separator string.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Return true if the string is null or ""
Converts "" to null
Converts null element to empty string ""
Replaces replaced
string occurrences from original
by the parameter by
.
This method returns a new string resulting from replacing all occurrences of
replaced in this string original with by.
original | the string to modify |
---|---|
replaced | the old character set |
by | the new character set |
NullPointerException | if one of the parameter string is null |
---|
Replaces replaced
string occurrences from original
that matches the given regular expression by
.
original | the string to modify |
---|---|
replaced | the regular expression to replace |
by | the new character set |
NullPointerException | if one of the parameter string is null |
---|
Splits a string into substrings, based on a separator string.
In Android
and iOS
this method
may return different results when the separator is the empty string "".
These limitations will be fixed in a future release, and the method will behave the same for all platforms.
string | the string to split (if null, the method will return null) |
---|---|
separator | the separator string to use for splitting (must not be null) |
NullPointerException | if separator is null |
---|