public class StringUtils extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
StringUtils.JoinCallback<T>
Callback interface used with various
VCardStringUtils.join()
methods. |
static interface |
StringUtils.JoinMapCallback<K,V>
Callback interface used with the
join(Map, String, JoinMapCallback) method. |
Modifier and Type | Field and Description |
---|---|
static String |
NEWLINE
The local computer's newline character sequence.
|
Modifier and Type | Method and Description |
---|---|
static <T> String |
join(Collection<T> collection,
String delimiter)
Joins a collection of values into a delimited list.
|
static <T> void |
join(Collection<T> collection,
String delimiter,
StringBuilder sb)
Joins a collection of values into a delimited list.
|
static <T> void |
join(Collection<T> collection,
String delimiter,
StringBuilder sb,
StringUtils.JoinCallback<T> join)
Joins a collection of values into a delimited list.
|
static <T> String |
join(Collection<T> collection,
String delimiter,
StringUtils.JoinCallback<T> join)
Joins a collection of values into a delimited list.
|
static <K,V> String |
join(Map<K,V> map,
String delimiter,
StringUtils.JoinMapCallback<K,V> join)
Joins a map into a delimited list.
|
static String |
ltrim(String string)
Trims the whitespace off the left side of a string.
|
static String |
rtrim(String string)
Trims the whitespace off the right side of a string.
|
public static final String NEWLINE
public static String ltrim(String string)
string
- the string to trimpublic static String rtrim(String string)
string
- the string to trimpublic static <T> String join(Collection<T> collection, String delimiter)
collection
- the collection of valuesdelimiter
- the delimiter (e.g. ",")public static <T> void join(Collection<T> collection, String delimiter, StringBuilder sb)
collection
- the collection of valuesdelimiter
- the delimiter (e.g. ",")sb
- the string builder to append ontopublic static <T> String join(Collection<T> collection, String delimiter, StringUtils.JoinCallback<T> join)
collection
- the collection of valuesdelimiter
- the delimiter (e.g. ",")join
- callback function to call on every element in the collectionpublic static <T> void join(Collection<T> collection, String delimiter, StringBuilder sb, StringUtils.JoinCallback<T> join)
collection
- the collection of valuesdelimiter
- the delimiter (e.g. ",")sb
- the string builder to append ontojoin
- callback function to call on every element in the collectionpublic static <K,V> String join(Map<K,V> map, String delimiter, StringUtils.JoinMapCallback<K,V> join)
map
- the mapdelimiter
- the delimiter (e.g. ",")join
- callback function to call on every element in the collectionThis software is published under the BSD license. Copyright © 2003-${build.year}, CRIXP AG, Switzerland, All rights reserved. Use is subject to license terms.