Package nva.commons.core
Class StringUtils
java.lang.Object
nva.commons.core.StringUtils
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanChecks if string input is blank or null.static booleanChecks if string input is empty or null.static booleanisNotBlank(String string) Checks if string is neither null or blank.static booleanisNotEmpty(String string) Checks if string is neither null or empty.static StringremoveMultipleWhiteSpaces(String input) Replaces multiple consecutive whitespaces with a single whitespace.static StringremoveWhiteSpaces(String input) Remove all whitespaces.static StringReplaces whitespaces with space.
-
Field Details
-
DOUBLE_WHITESPACE
- See Also:
-
WHITESPACES
- See Also:
-
SPACE
- See Also:
-
EMPTY_STRING
- See Also:
-
-
Method Details
-
removeMultipleWhiteSpaces
Replaces multiple consecutive whitespaces with a single whitespace.- Parameters:
input- A string with or without multiple consecutive whitespaces.- Returns:
- A string without multiple consecutive whitespaces where are whitespaces have been replaced by a space.
-
removeWhiteSpaces
Remove all whitespaces.- Parameters:
input- A string with or without multiple consecutive whitespaces.- Returns:
- a string without spaces.
-
isBlank
Checks if string input is blank or null.- Parameters:
input- input string- Returns:
trueif blank.
-
isEmpty
Checks if string input is empty or null.- Parameters:
input- input string- Returns:
trueif empty.
-
replaceWhiteSpacesWithSpace
Replaces whitespaces with space.- Parameters:
str- input string.- Returns:
- string with all whitespaces replaced by spaces
-
isNotEmpty
Checks if string is neither null or empty.- Parameters:
string- string to check- Returns:
trueif string is neither null or empty.
-
isNotBlank
Checks if string is neither null or blank.- Parameters:
string- string to check- Returns:
trueif string is neither null or empty.
-