public abstract class Strings extends Object
| Constructor and Description |
|---|
Strings() |
| Modifier and Type | Method and Description |
|---|---|
static String |
concat(Iterable<String> iterable)
Concatenate an iterable of Strings into a single String.
|
static String |
concat(Iterator<String> iterator)
Concatenate an iterator of Strings into a single String.
|
static String |
concat(String... array)
Concatenate an array of Strings into a single String.
|
static <T,V> String |
interpose(Iterable<T> values,
Iterator<V> separators)
Creates a string by interposing stringified values from the source iterable with values from the separators.
|
static <T,V> String |
interpose(Iterable<T> values,
V separator)
Creates a string by interposing stringified values from the source iterable with the separator.
|
static <T,V> String |
interpose(Iterator<T> values,
Iterator<V> separators)
Creates a string by interposing stringified values from the source iterator with values from the separators.
|
static <T,V> String |
interpose(Iterator<T> values,
V separator)
Creates a string by interposing stringified values from the source iterator with the separator.
|
static <T,V> String |
interpose(T[] values,
Iterator<V> separators)
Creates a string by interposing stringified values from the source array with values from the separators.
|
static <T,V> String |
interpose(T[] values,
V separator)
Creates a string by interposing stringified values from the source array with the separator.
|
static <T> String |
join(Iterable<T> iterable)
Joins an iterable of T into a String.
|
static <T> String |
join(Iterator<T> iterator)
Joins an iterator of T into a String.
|
static <T> String |
join(T[] array)
Joins an array of T into a String.
|
static String |
repeat(char source,
int times)
Creates a String by repeating the source char.
|
static String |
repeat(String source,
int times)
Creates a String by repeating the source string.
|
public static String concat(String... array)
["1","2","3"] -> "123"array - the array to be concatenatedpublic static String concat(Iterable<String> iterable)
["1","2","3"] -> "123"iterable - the iterable to be concatenatedpublic static String concat(Iterator<String> iterator)
["1","2","3"] -> "123"iterator - the iterator to be concatenatedpublic static <T> String join(T[] array)
[1,2,3] -> "123"T - the array element typearray - the array to be joinedpublic static <T> String join(Iterable<T> iterable)
[1,2,3] -> "123"T - the iterable element typeiterable - the iterable to be joinedpublic static <T> String join(Iterator<T> iterator)
[1,2,3] -> "123"T - the iterator element typeiterator - the iterator to be joinedpublic static <T,V> String interpose(T[] values, Iterator<V> separators)
interpose([1,2,3,4,5], ["-", ","]) -> "1-2,3-4,5"T - the array element typeV - the separator typevalues - the source arrayseparators - the separatorspublic static <T,V> String interpose(Iterable<T> values, Iterator<V> separators)
interpose([1,2,3,4,5], ["-", ","]) -> "1-2,3-4,5"T - the iterable element typeV - the separator typevalues - the source iterableseparators - the separatorspublic static <T,V> String interpose(Iterator<T> values, Iterator<V> separators)
interpose([1,2,3,4,5], ["-", ","]) -> "1-2,3-4,5"T - the a element typeV - the separator typevalues - the source iteratorseparators - the separatorspublic static <T,V> String interpose(T[] values, V separator)
interpose([1,2,3], "-") -> "1-2-3"T - the iterable element typeV - the separator typevalues - the source arrayseparator - the separatorpublic static <T,V> String interpose(Iterable<T> values, V separator)
interpose([1,2,3], "-") -> "1-2-3"T - the iterable element typeV - the separator typevalues - the source iterableseparator - the separatorpublic static <T,V> String interpose(Iterator<T> values, V separator)
interpose([1,2,3], "-") -> "1-2-3"T - the iterable element typeV - the separator typevalues - the source iteratorseparator - the separatorpublic static String repeat(char source, int times)
source - the source chartimes - times the source char will be repeatedCopyright © 2017. All rights reserved.