public class StringUtils
extends java.lang.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 java.lang.String |
NEWLINE
The local computer's newline character sequence.
|
Modifier and Type | Method and Description |
---|---|
static <T> java.lang.String |
join(java.util.Collection<T> collection,
java.lang.String delimiter)
Joins a collection of values into a delimited list.
|
static <T> void |
join(java.util.Collection<T> collection,
java.lang.String delimiter,
java.lang.StringBuilder sb)
Joins a collection of values into a delimited list.
|
static <T> void |
join(java.util.Collection<T> collection,
java.lang.String delimiter,
java.lang.StringBuilder sb,
StringUtils.JoinCallback<T> join)
Joins a collection of values into a delimited list.
|
static <T> java.lang.String |
join(java.util.Collection<T> collection,
java.lang.String delimiter,
StringUtils.JoinCallback<T> join)
Joins a collection of values into a delimited list.
|
static <K,V> java.lang.String |
join(java.util.Map<K,V> map,
java.lang.String delimiter,
StringUtils.JoinMapCallback<K,V> join)
Joins a map into a delimited list.
|
static java.lang.String |
ltrim(java.lang.String string)
Trims the whitespace off the left side of a string.
|
static java.lang.String |
rtrim(java.lang.String string)
Trims the whitespace off the right side of a string.
|
public static final java.lang.String NEWLINE
public static java.lang.String ltrim(java.lang.String string)
string
- the string to trimpublic static java.lang.String rtrim(java.lang.String string)
string
- the string to trimpublic static <T> java.lang.String join(java.util.Collection<T> collection, java.lang.String delimiter)
collection
- the collection of valuesdelimiter
- the delimiter (e.g. ",")public static <T> void join(java.util.Collection<T> collection, java.lang.String delimiter, java.lang.StringBuilder sb)
collection
- the collection of valuesdelimiter
- the delimiter (e.g. ",")sb
- the string builder to append ontopublic static <T> java.lang.String join(java.util.Collection<T> collection, java.lang.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(java.util.Collection<T> collection, java.lang.String delimiter, java.lang.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> java.lang.String join(java.util.Map<K,V> map, java.lang.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.