public final class StringUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static String |
concat(String... texts)
concatenate all elements with empty string value.
|
static <E> String |
concatElements(Collection<E> collection)
Concatenate elements with empty text.
|
static <E> String |
concatElements(Collection<E> collection,
Function<E,String> mapper)
Concatenate elements with empty text with mapper from E type to String.
|
static <E> String |
concatElements(Collection<E> collection,
Function<E,String> mapper,
String joinText)
Concatenate elements with joinText value with mapper from E type to String.
|
static <E> String |
concatElements(Collection<E> collection,
String joinText)
Concatenate elements with joinText value.
|
static <E> String |
concatElements(String textPrefix,
Collection<E> collection,
Function<E,String> mapper,
String joinText,
String textSuffix)
Concatenate elements with prefix, join text between all elements and with suffix value with mapper from E type to String.
|
static <E> String |
concatElements(String textPrefix,
Collection<E> collection,
String joinText,
String textSuffix)
Concatenate elements with prefix, join text between all elements and with suffix value with mapper from E type to String.
|
static String |
concatElements(String joinText,
String... texts)
This method concatenate all texts from array with join Text.
|
static <E> String |
concatElementsAsLines(Function<E,String> mapper,
E... elements)
Return concatenated text from mapped all array elements to text as new lines.
|
static <E> String |
concatElementsAsLines(List<E> elements)
Return concatenated text all list elements as new lines.
|
static <E> String |
concatElementsAsLines(List<E> elements,
Function<E,String> mapper)
Return concatenated text all list elements as new lines.
|
static String |
concatElementsAsLines(Object... elements)
Return concatenated text all array elements as new lines.
|
static String |
concatObjects(Object... texts)
concatenate all object with empty string value.
|
static int |
countSearchedChar(String text,
char searchedChar)
It returns number of searched char in provided text.
|
static boolean |
isBlank(String text)
If whole text contains only white signs then return true.
|
static boolean |
isEmpty(String text)
Check that text is empty or null.
|
static boolean |
isNotBlank(String text)
If whole text doesn't contain only white signs then return true.
|
static boolean |
isNotEmpty(String text)
Check that text is not empty.
|
static String |
repeatTextNTimes(int nTimes,
String text)
It create text with n times repeated text.
|
static String |
tabsNTimes(int tabsNumber)
It return N times of tabulator.
|
public static boolean isEmpty(String text)
text - to check.public static boolean isNotEmpty(String text)
text - to check.public static boolean isBlank(String text)
text - to check.public static boolean isNotBlank(String text)
text - to check.public static <E> String concatElementsAsLines(List<E> elements)
elements - to concatenatepublic static String concatElementsAsLines(Object... elements)
elements - to concatenatepublic static <E> String concatElementsAsLines(Function<E,String> mapper, E... elements)
elements - to concatenatepublic static <E> String concatElementsAsLines(List<E> elements, Function<E,String> mapper)
E - generic type forelements - to concatenatemapper - for from E type to stringpublic static String tabsNTimes(int tabsNumber)
tabsNumber - number of Tabspublic static String repeatTextNTimes(int nTimes, String text)
nTimes - number to repeattext - value to repeatpublic static <E> String concatElements(Collection<E> collection)
E - generic type of collection.collection - elements to concatenatepublic static <E> String concatElements(Collection<E> collection, Function<E,String> mapper)
E - generic type of collection.collection - elements to concatenatemapper - from some type to Stringpublic static <E> String concatElements(Collection<E> collection, String joinText)
E - generic type of collection.collection - elements to concatenatejoinText - value between all texts.public static <E> String concatElements(Collection<E> collection, Function<E,String> mapper, String joinText)
E - generic type of collection.collection - elements to concatenatemapper - from some type to StringjoinText - value between all texts.public static <E> String concatElements(String textPrefix, Collection<E> collection, Function<E,String> mapper, String joinText, String textSuffix)
E - generic type of collection.textPrefix - text before all concatenated textcollection - elements to concatenatemapper - from some type to StringjoinText - value between all texts.textSuffix - text after all concatenated textpublic static <E> String concatElements(String textPrefix, Collection<E> collection, String joinText, String textSuffix)
E - generic type of collection.textPrefix - text before all concatenated textcollection - elements to concatenatejoinText - value between all texts.textSuffix - text after all concatenated textpublic static String concatElements(String joinText, String... texts)
joinText - between all varargs.texts - varargs for text.public static String concat(String... texts)
texts - to concatenatepublic static String concatObjects(Object... texts)
texts - to concatenatepublic static int countSearchedChar(String text, char searchedChar)
text - for searchsearchedChar - char which is searchedCopyright © 2019. All rights reserved.