public final class StringUtils extends Object
Modifier and Type | Method and Description |
---|---|
static String |
join(Iterator iterator,
char separator)
Joins the elements of the provided
Iterator into
a single String containing the provided elements. |
static String |
join(Object[] array,
char separator)
Joins the elements of the provided array into a single String
containing the provided list of elements.
|
static String |
replace(String text,
String searchString,
String replacement) |
public static String join(Object[] array, char separator)
Joins the elements of the provided array into a single String containing the provided list of elements.
No delimiter is added before or after the list. Null objects or empty strings within the array are represented by empty strings.
StringUtils.join(null, *) = null StringUtils.join([], *) = "" StringUtils.join([null], *) = "" StringUtils.join(["a", "b", "c"], ';') = "a;b;c" StringUtils.join(["a", "b", "c"], null) = "abc" StringUtils.join([null, "", "a"], ';') = ";;a"
array
- the array of values to join together, may be nullseparator
- the separator character to usenull
if null array inputpublic static String join(Iterator iterator, char separator)
Joins the elements of the provided Iterator
into
a single String containing the provided elements.
No delimiter is added before or after the list. Null objects or empty strings within the iteration are represented by empty strings.
See the examples here: join(Object[],char)
.
iterator
- the Iterator
of values to join together, may be nullseparator
- the separator character to usenull
if null iterator inputCopyright © 2001-2016 The Apache Software Foundation. All Rights Reserved.