public abstract class Strings extends Object
| Constructor and Description |
|---|
Strings() |
| Modifier and Type | Method and Description |
|---|---|
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.
|
public 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 separatorCopyright © 2012. All Rights Reserved.