Package net.codecrete.qrbill.generator
Class Strings
java.lang.Object
net.codecrete.qrbill.generator.Strings
Helper function for processing strings.
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisNullOrEmpty(String value) Tests if a string is null or emptystatic StringspacesCleaned(String value) Returns a string without leading and trailing spaces and with all consecutive space characters replaced by a single space.static StringReturns string with leading and trailing whitespace removedstatic StringwhiteSpaceRemoved(String value) Returns string without white space
-
Method Details
-
trimmed
Returns string with leading and trailing whitespace removedFor empty strings or
null,nullis returned.- Parameters:
value- string to trim ornull- Returns:
- trimmed string
-
whiteSpaceRemoved
Returns string without white space- Parameters:
value- string to process (non-null)- Returns:
- resulting string with all whitespace removed
-
isNullOrEmpty
Tests if a string is null or emptyA string consisting of all whitespace is considered empty.
- Parameters:
value- string to test- Returns:
- boolean indicating if string is null or empty
-
spacesCleaned
Returns a string without leading and trailing spaces and with all consecutive space characters replaced by a single space.Whitespace other than space characters are not cleaned.
- Parameters:
value- string to clean (non-null)- Returns:
- cleaned string
-