|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
org.apache.myfaces.trinidad.util.StringUtils
public final class StringUtils
This class contains String utilities. The code was taken from Apache Commons, LANG project. Reason is to provide an alternate method to java.lang.String.replace(). That method uses java.util.regex.Pattern.matcher(), which has a PERF issue.
| Method Summary | |
|---|---|
static java.lang.String |
join(java.util.Iterator iterator, char separator)Joins the elements of the provided Iterator into a single String containing the provided elements. |
static java.lang.String |
join(java.lang.Object[] array, char separator)Joins the elements of the provided array into a single String containing the provided list of elements. |
static java.lang.String |
replace(java.lang.String text, java.lang.String searchString, java.lang.String replacement) |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static java.lang.String replace(java.lang.String text,
java.lang.String searchString,
java.lang.String replacement)
public static java.lang.String join(java.lang.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 input
public static java.lang.String join(java.util.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 input
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Copyright © 2001-2012 The Apache Software Foundation. All Rights Reserved.