Modifiers | Name | Description |
---|---|---|
static java.lang.String |
BOOLEAN_TRUE_VALUE |
|
static java.lang.String |
BREAK_LINE_HTML_TAG |
Html tag that is used for breaking lines |
static char |
CHAR_WITH_ZERO_WIDTH |
Zero-width space |
static java.lang.String |
COLON |
|
static char |
DEFAULT_CSV_DELIMITER |
Default Comma-Separated-Values sign |
static char |
DEFAULT_FILENAME_WHITESPACE_CHAR |
Default char that it used instead of whitespaces in file names |
static java.lang.String |
DEFAULT_NEWLINE |
New line elements that are considered default |
static char |
ELLIPSIS |
Series of three dots as a symbol |
static java.lang.String |
EMPTY |
|
static java.lang.String |
NEWLINE |
OS dependent line separator |
Type Params | Return Type | Name and description |
---|---|---|
|
static java.lang.String |
addEndingDotIfNecessary(java.lang.String value) Puts a full stop at the end of the sentence, if there is no dot |
|
static java.lang.String |
capitalize(java.lang.String string) Null safe method; capitalizes the word |
|
static boolean |
containsIgnoreCase(java.lang.String str, java.lang.String searchStr) Determines whether a string contains a substring. |
|
static java.lang.String |
createFileName(java.lang.String str, char whitespaceChar) Replaces whitespaces from the file name |
|
static java.lang.String |
createFileName(java.lang.String str) Replaces the whitespaces from the file name replacing them with the DEFAULT_FILENAME_WHITESPACE_CHAR |
|
static java.lang.String |
createFileName2(java.lang.String str, char replace) Replaces all non letter and non digit characters from the file name |
|
static java.io.Writer |
createSeparatedRow(java.io.Writer writer, StringList values, char separator, char quote) Splits the content of the provided StringList with the specified separator and frame each word with the specified quotation marks |
|
static java.lang.String |
createXmlName(java.lang.String str) Creates the appropriate name for the file in xml format by removing all the unacceptable symbols. |
|
static java.lang.String |
decapitalize(java.lang.String name) |
|
static java.lang.String |
defaultIfEmpty(java.lang.String string, java.lang.String defaultString) @return the defaultString when provided string is null or empty,
else the method returns initial string |
|
static java.lang.String |
emptyIfNull(java.lang.String baseString) Converts the String into a null safe parameter |
|
static java.lang.String |
fixLineSeparator(java.lang.String xml) Null safe method, replaces all the line separators to OS friendly ones |
|
static java.lang.String |
getEncodedStringSafely(byte[] bytes, java.lang.String encoding) Constructs the new String by decoding the provided array of bytes using the the specified charset |
|
static java.lang.String |
getSubstringBeforeFirstWhitespace(java.lang.String originalString) Returns a String that is positioned before the first whitespace in the specified text |
|
static java.lang.String |
getValidFileName(java.lang.String name) Replaces all the punctuation marks with the underscore symbol |
|
static boolean |
hasContent(java.lang.String str) Checks if there any content in the provided String |
|
static boolean |
isBlank(java.lang.String string) |
|
static boolean |
isNullOrEmpty(java.lang.String str) Checks if the input string is empty or null |
|
static boolean |
isNumeric(java.lang.String s) Null safe method; checks if the String is numeric |
|
static boolean |
isValidTagName(java.lang.String tagName) Checks if the tag name is valid |
|
static java.lang.String |
join(java.lang.String[] array, java.lang.String separator) Builds a String from the array elements and separates them with provided separator |
|
static java.lang.String |
maybePlural(java.lang.String str, int count) Simplest possible pluralization of provided word by adding an 's' to it |
|
static java.lang.String[] |
merge(java.lang.String[] incomingNames, java.lang.String string) Increases the size of a String array, adding the provided String to it. |
|
static java.lang.String |
normalizeSpace(java.lang.String str) Removes multiple whitespaces if any of them appears in the provided text, replacing them with single ones |
|
static java.lang.String |
nullIfEmtpy(java.lang.String string) Handles the input String , this method returns null, if it is empty or null |
|
static int |
parseInt(java.lang.String str, int defaultValue) Parses the string argument into a signed decimal integer; null safe method |
|
static java.lang.String |
quote(java.lang.String str) Null safe method; surrounds the initial String with double quotes |
|
static StringList |
readSeparatedRow(java.lang.String row, char separator, char quote) Converts the text which was created by StringUtils.createSeparatedRow to StringList |
|
static java.lang.String |
removeSingleAndDoubleQuotes(java.lang.String input) Removes leading and trailing whitespaces and single or double quotes from the provided string |
|
static java.lang.String |
repeat(java.lang.String s, int count) Repeats the String as many times as it was asked for |
|
static java.lang.String |
replace(java.lang.String data, java.lang.String from, java.lang.String to) Replaces the provided part of a String with another one, the 'case insensitivity' option
is false by default |
|
static java.lang.String |
replace(java.lang.String data, java.lang.String from, java.lang.String to, boolean caseInsensitive) Replaces the provided part in a String with another one with presence of the case insensitivity option |
|
static java.lang.String |
replace(java.lang.String data, java.lang.String from, java.lang.String to, boolean caseInsensitive, boolean firstOnly) Replaces the provided part in a String with another one with the case insensitivity option. |
|
static java.lang.String |
replaceFirst(java.lang.String data, java.lang.String from, java.lang.String to, boolean caseInsensitive) Replaces the first entry of the provided part in a String with another one with the case insensitivity option |
|
static java.lang.String |
replaceRegExUnescaped(java.lang.String text) Replaces escaped sequences in the provided String by adding leading backslash |
|
static boolean |
sameString(java.lang.String str1, java.lang.String str2) Null safe method that checks if provided strings are equal to each other |
|
static boolean |
sameStringLists(java.util.List<java.lang.String> strList1, java.util.List<java.lang.String> strList2) Null safe method checks if provided string lists are equal to each other. |
|
static boolean |
sameText(java.lang.String str1, java.lang.String str2) Null safe method checks if provided strings are equal to each other ignoring case |
|
static java.lang.String |
sanitizeFilename(java.lang.String name) Replaces a pound sign with the proper unicode symbol, also replaces the symbols that are incorrect for file naming with a dash |
|
static java.lang.String |
singleQuote(java.lang.String str) Null safe method; surrounds initial String with single quotes |
|
static java.lang.String[] |
sortNames(java.lang.String[] names) Sorts the String array according to Comparable natural ordering of its elements |
|
static java.lang.String |
spacifyOnCapital(java.lang.String name) @deprecated replaced by StringUtils.specifyOnCapital |
|
static java.lang.String |
specifyOnCapital(java.lang.String name) Separates the word with the whitespace aligning capital letters, also the method trims the leading and trailing whitespaces. |
|
static java.util.List<java.lang.String> |
splitLines(java.lang.String string) Splits the text by lines |
|
static boolean |
startsWithCaseInsensitive(java.lang.String string, java.lang.String prefix) Checks if the provided string begins with the specified prefix ignoring case |
|
static java.lang.String |
stripStartAndEnd(java.lang.String s, java.lang.String start, java.lang.String end) Truncates the String according to given parameters |
|
static java.lang.String |
toHtml(java.lang.String string) Transforms the String to the content of an html format document with the default max size that is 0 |
|
static java.lang.String |
toHtml(java.lang.String string, int maxSize) Transforms the String to the content of a simple html format document, taking down the initial string
with tag depending on the presence of the newline characters in the string |
|
static java.lang.String |
toString(java.lang.Object object) Returns the String representation of a provided {@code} Object |
|
static java.lang.String[] |
toStringArray(java.lang.Object[] selectedOptions) Returns the String array representation of the provided Object array |
|
static java.util.List<java.lang.String> |
toStringList(java.lang.Object[] selectedOptions) Returns the List<String> representation of the provided Object array |
|
static java.lang.String |
toStringOrEmpty(java.lang.Object toString) |
|
static java.lang.String |
toStringOrNull(java.lang.Object toString) Null safe method, that transforms the provided Object to the String . |
|
static java.lang.String |
trimRight(java.lang.String str, java.lang.String substring) Trims the end of the word as many times as it equals to provided substring |
|
static java.lang.String |
truncate(java.lang.String originalString, int limit) Reduces the length of the provided String in order to reach the limit |
|
static java.lang.String |
truncate(java.lang.String originalString, int limit, java.lang.String ending) @param originalString |
|
static java.lang.String |
truncateStart(java.lang.String str, int limit) Truncates the beginning of the word in order to reach limit |
|
static java.lang.String |
truncateStartOfUrl(java.lang.String urlString, int limit) Truncates the query parameters from the String url and then cuts it from the beginning
to reach the limit. |
|
static java.lang.String |
truncateUrl(java.lang.String urlString, int limit) Truncates the query parameters from the String url and then cuts it from the end
to reach the limit. |
|
static java.lang.String |
unquote(java.lang.String str) Removes leading and trailing double quotes from the provided string |
|
static java.lang.String |
unquoteStartAndEnd(java.lang.String str) Removes leading and/or trailing double quotes from the provided string |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Html tag that is used for breaking lines
Zero-width space
Default Comma-Separated-Values sign
Default char that it used instead of whitespaces in file names
New line elements that are considered default
Series of three dots as a symbol
OS dependent line separator
Puts a full stop at the end of the sentence, if there is no dot
value
- the provided String
in the end of which a full stop should be putString
ends with dot initial String
in case if there was a dot in the end of it.Null safe method; capitalizes the word
string
- the initial wordDetermines whether a string contains a substring. The search is made case-insensitively.
str
- the string to search {@param searchStr} insearchStr
- the string to search fortrue
if {@param searchStr} is found in {@param str}, false
otherwiseReplaces whitespaces from the file name
str
- the file name where all the whitespaces should be replaced with a specified symbol
whitespaceChar
whitespaceChar
- the symbol that replaces all the whitespace in the file nameReplaces the whitespaces from the file name replacing them with the DEFAULT_FILENAME_WHITESPACE_CHAR
str
- the filename where all the whitespaces should be replaced with
DEFAULT_FILENAME_WHITESPACE_CHARString
with the replaced whitespacesReplaces all non letter and non digit characters from the file name
str
- the file namereplace
- the symbol for replacingSplits the content of the provided StringList with the specified separator and frame each word with the specified quotation marks
writer
- character stream which contains resultvalues
- list of String
sseparator
- char
that separates wordsquote
- char
that is used as a quotation mark to frame each wordWriter
with transformed String
sCreates the appropriate name for the file in xml format by removing all the unacceptable symbols. This method also validate file name {
str
- the initial {@code String
defaultString
when provided string
is null or empty,
else the method returns initial string
Converts the String
into a null safe parameter
baseString
- the null safe String
String
in case when provided baseString
is null or empty,
else the method returns initial baseString
Null safe method, replaces all the line separators to OS friendly ones
xml
- the String
to be transformedString
Constructs the new String
by decoding the provided array of bytes using the the specified charset
bytes
- the array of bytes to be decoded into String
encoding
- the name of a supported java.nio.charset.CharsetString
Returns a String
that is positioned before the first whitespace in the specified text
originalString
- the String
to be cutString
that contains all the symbols before the first whitespace in initial String
Replaces all the punctuation marks with the underscore symbol
name
- the String
with the punctuation marks in its structureString
without any punctuation marks Checks if there any content in the provided String
str
- the word to be checkedtrue
if there is any content in the str
, false
otherwiseChecks if the input string is empty or null
str
- the word for checking Null safe method; checks if the String
is numeric
s
- the String
to be checkedtrue
if the provided String
consists of decimal or floating-point number,
admits '+' and 'minus' symbols beforehead, returns false
if the provided String
is null or
its content is not numericChecks if the tag name is valid
tagName
- the tag to be checkedtrue
if provided String
matches following conditions:
- not null
- not empty
- the length of it is less or equal to StringUtils#MAX_TAG_LEN
- should consists of letters or whitespaces and letters
returns false
in any other case. Builds a String from the array elements and separates them with provided separator
array
- the initial array all the elements of which should be unitedseparator
- the word that should separate united elementsString
from the array
contentsSimplest possible pluralization of provided word by adding an 's' to it
str
- the word to be pluralizedcount
- should be equals any number but 1 in order to evaluate transformationcount
was equal to 1 Increases the size of a String
array, adding the provided String
to it.
incomingNames
- the initial array to be increasedstring
- the String
that should be added into incomingNames
incomingNames
and string
Removes multiple whitespaces if any of them appears in the provided text, replacing them with single ones
str
- null safe parameter; the text to be formattedString
with absence of multiple whitespaces; returns the empty String
in case if the
initial text is empty Handles the input String
, this method returns null, if it is empty or null
string
- the word for handlingnull
if provided string is empty or consists of whitespace/s only,
else the method returns the initial wordParses the string argument into a signed decimal integer; null safe method
str
- the String
to be parseddefaultValue
- returns this value in case of the str
parameter is null
or {@exception NullFormatException} Null safe method; surrounds the initial String
with double quotes
str
- the initial String
; it should not starts or end with double quotesString
surrounded by double quotesConverts the text which was created by StringUtils.createSeparatedRow to StringList
row
- the provided String
to be separatedseparator
- the char element which is considered as a separating elementquote
- the quotation mark which is used in the row
StringList
that consists of provided String elementsRemoves leading and trailing whitespaces and single or double quotes from the provided string
input
- the word to be transformed Repeats the String
as many times as it was asked for
s
- null safe parameter; the text to be repeatedcount
- the decimal parameter that shows the necessarily number of repeatingString
that was copied as many times as the count
variable determined Replaces the provided part of a String
with another one, the 'case insensitivity' option
is false
by default
data
- the provided String
to be changedfrom
- the part of the data
that should be changedto
- from
will be changed to that variableString
Replaces the provided part in a String
with another one with presence of the case insensitivity option
data
- the String
to be changedfrom
- the part of the data
that should be changedto
- from
will be changed to that variablecaseInsensitive
- the case insensitivity optionString
Replaces the provided part in a String
with another one with the case insensitivity option. Also it allows
to choose either one or every entry should be changed
data
- the String
to be changedfrom
- the part of the data
that should be changedto
- from
will be changed to that variablecaseInsensitive
- the setting of case-sensitivity; true
- ignore case, false
- consider casefirstOnly
- the setting that figured out if the first entry only should be replacedString
Replaces the first entry of the provided part in a String
with another one with the case insensitivity option
data
- the String
to be changedfrom
- the part of the data
that should be changedto
- from
will be changed to that variablecaseInsensitive
- the case insensitivity optionString
Replaces escaped sequences in the provided String
by adding leading backslash
text
- the initial String
in which there are symbols to be replacedString
in which escaped sequences were replaced by adding leading backslashNull safe method that checks if provided strings are equal to each other
str1
- The first word to comparestr2
- The second word to comparetrue
if both of the arguments are nullable or they are equal to each other considering case;
false
otherwise Null safe method checks if provided string lists are equal to each other. According to
this method the lists are equal if they both are null
or contain the same amount
of equal items.
strList1
- The first string list to comparestrList2
- The second string list to comparetrue
if the arguments are equal to each other, or both of them are null
;
false
otherwiseNull safe method checks if provided strings are equal to each other ignoring case
str1
- The first word to comparestr2
- The second word to comparetrue
if the arguments are equal to each other ignoring case, or both of them are nullable;
false
otherwiseReplaces a pound sign with the proper unicode symbol, also replaces the symbols that are incorrect for file naming with a dash
name
- the provided file name Null safe method; surrounds initial String
with single quotes
str
- the initial String
; it should not starts or end with single quotesString
surrounded by single quotes Sorts the String
array according to Comparable
natural ordering of its elements
names
- the array to be sortedSeparates the word with the whitespace aligning capital letters, also the method trims the leading and trailing whitespaces.
name
- {theString
Splits the text by lines
string
- the text to be split, not null
value is requiredstring
Checks if the provided string
begins with the specified prefix
ignoring case
string
- the initial String
to be validatedprefix
- the String
prefix for validatingtrue
if the string
begins with the prefix
ignoring case; else returns false
Truncates the String
according to given parameters
s
- the String
to be truncatedstart
- should be equal to the beginning of the s
to remove it from the provided s
end
- should be equal to the end of the s
to remove it from provided s
String
Transforms the String
to the content of an html format document with the default max size that is 0
string
- the initital String
to be transformedString
Transforms the String
to the content of a simple html format document, taking down the initial string
with
tag depending on the presence of the newline characters in the string
string
- the initial String
to be transformedmaxSize
- limits the length of the result String
, it includes the default opening tags length ()
and the text that precede the newline character. The excess text is replaced by ellipses.
0 value means infinite size of the resulting text
any other value restricts result String
String
that is transformed into the content of an html format document Returns the String
representation of a provided {@code} Object
object
- the object which toString() method we want to callString
representation of an Object
Returns the String
array representation of the provided Object array
selectedOptions
- the array every element of which should be represent as a String
element in the arrayString
Returns the List<String>
representation of the provided Object
array
selectedOptions
- the array every element of which should be represent as a String
element in List
List
consisted of String
s, which was created from an array of Object
s Null safe method, that transforms the provided Object
to the String
.
toString
- an object to be converted to String
toString#toString()
methodTrims the end of the word as many times as it equals to provided substring
str
- null safe parameter; Provided value should ends with substring for proper transformationsubstring
- the sequence of characters to be truncated from the word Reduces the length of the provided String
in order to reach the limit
originalString
- null safe String
parameter; the word to be truncatedlimit
- the length of the resulting word. That value should be shorter than the length of the initial
str
String
if str
was null
Truncates the beginning of the word in order to reach limit
str
- the word to be truncatedlimit
- the length of the resulting word. That value should be shorter than the length of provided str
Truncates the query parameters from the String
url and then cuts it from the beginning
to reach the limit. Removed symbols will be replaced with the ellipsis
urlString
- url to be truncatedlimit
- quantity of symbols that should remain in url including ellipsis symbols Truncates the query parameters from the String
url and then cuts it from the end
to reach the limit. Removed symbols will be replaced with the ellipsis
urlString
- the url to be truncatedlimit
- the quantity of symbols that should remain in urlRemoves leading and trailing double quotes from the provided string
str
- null safe String
parameter to be transformed. It should begins and ends with
double quotation marks for proper transformationRemoves leading and/or trailing double quotes from the provided string
str
- null safe String
parameter to be transformed. It should begins and/or ends with
double quotation marks for proper transformation