public class StringUtil
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String[] |
explode(java.lang.String string,
java.lang.String delimiter)
Splits a string using delimiter as a separator of elements into an array.
|
static java.lang.String |
fromBinary(java.lang.String binarySequence)
Translates a binary representation of a string to the respective string.
|
static java.lang.String[] |
getArrayWithValues(int size,
java.lang.String value) |
static char[] |
getCommonChars(boolean includeDigits)
Getter for all available common characters of the system.
|
static java.lang.String |
getRandomString(int length,
char[] chars,
long seed)
Returns a random string of a desired length and from a given set of characters.
|
static java.lang.String |
implode(java.util.Collection<?> set,
java.lang.String delimiter)
Concatenates the string representations of a set of objects using the specified delimiter as a separator.
|
static java.lang.String |
implode(java.util.Collection<java.lang.Object> collection)
Concatenates the string representations of a collection of objects using ", " as a separator.
|
static java.lang.String |
implode(java.lang.Object[] array)
Concatenates the string representations of an array of objects using ", " as a separator.
|
static java.lang.String |
implode(java.lang.Object[] array,
java.lang.String delimiter)
Concatenates the string representations of an array of objects using the specified delimiter as a separator.
|
static java.lang.String |
implode(java.util.Set<java.lang.Object> set)
Concatenates the string representations of a set of objects using ", " as a separator.
|
static java.lang.String[] |
merge(java.lang.String[] array1,
java.lang.String[] array2)
Merges two string arrays into one single array.
|
static java.lang.String[] |
shiftFirst(java.lang.String[] input)
Removes the first entry of the value and returns an array containing all values but the first one.
|
static java.lang.String |
stripChar(java.lang.String str,
char c)
Strips a specific character from a string.
|
static java.lang.String |
toStringLimited(java.lang.Object o,
int limit)
Limits the toString output of an object to a specified length.
|
public static char[] getCommonChars(boolean includeDigits)
includeDigits - Flag whether to include digits in the array of the system's common characters.public static java.lang.String getRandomString(int length,
char[] chars,
long seed)
length - The length of the resulting random string.chars - The set of characters to be used to generate a random string.public static java.lang.String implode(java.lang.Object[] array)
array - The array of objects of which the string representation is to be concatenated.public static java.lang.String implode(java.util.Set<java.lang.Object> set)
set - The set of objects of which the string representation is to be concatenated.public static java.lang.String implode(java.util.Collection<?> set,
java.lang.String delimiter)
set - The set of objects of which the string representation is to be concatenated.delimter - A string separating the respective string representations.public static java.lang.String implode(java.util.Collection<java.lang.Object> collection)
collection - The set of objects of which the string representation is to be concatenated.public static java.lang.String implode(java.lang.Object[] array,
java.lang.String delimiter)
array - The array of objects of which the string representation is to be concatenated.delimter - A string separating the respective string representations.public static java.lang.String[] explode(java.lang.String string,
java.lang.String delimiter)
string - The string to be split.delimiter - A string separating the sub-strings.public static java.lang.String[] merge(java.lang.String[] array1,
java.lang.String[] array2)
array1 - The first array.array2 - The second array.public static java.lang.String[] getArrayWithValues(int size,
java.lang.String value)
public static java.lang.String stripChar(java.lang.String str,
char c)
str - The string from which the character shall be stripped.c - The character to strip.public static java.lang.String[] shiftFirst(java.lang.String[] input)
input - The array of values to be shifted.public static java.lang.String fromBinary(java.lang.String binarySequence)
binarySequence - The binary encoding of the string.public static java.lang.String toStringLimited(java.lang.Object o,
int limit)
o - The object for which a string limited string representation is to be obtained.limit - The maximum length of the toString output.