|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.codehaus.tycho.surefire.osgibooter.StringUtils
public class StringUtils
Copy&paste from org.codehaus.plexus.util.StringUtils
Constructor Summary | |
---|---|
StringUtils()
|
Method Summary | |
---|---|
static String |
join(Object[] array,
String separator)
Joins the elements of the provided array into a single String containing the provided list of elements. |
static String |
replace(String text,
String repl,
String with)
Replace all occurances of a String within another String. |
static String |
replace(String text,
String repl,
String with,
int max)
Replace a String with another String inside a larger String, for the first max values of the search String. |
static String[] |
split(String text,
String separator)
|
static String[] |
split(String str,
String separator,
int max)
Splits the provided text into a array, based on a given separator. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StringUtils()
Method Detail |
---|
public static String join(Object[] array, String 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. A
null
separator is the same as a blank String.
array
- the array of values to join togetherseparator
- the separator character to use
public static String[] split(String text, String separator)
split(String, String, int)
public static String[] split(String str, String separator, int max)
Splits the provided text into a array, based on a given separator.
The separator is not included in the returned String array. The
maximum number of splits to perfom can be controlled. A null
separator will cause parsing to be on whitespace.
This is useful for quickly splitting a String directly into
an array of tokens, instead of an enumeration of tokens (as
StringTokenizer
does).
str
- The string to parse.separator
- Characters used as the delimiters. If
null
, splits on whitespace.max
- The maximum number of elements to include in the
array. A zero or negative value implies no limit.
public static String replace(String text, String repl, String with)
Replace all occurances of a String within another String.
A null
reference passed to this method is a no-op.
text
- text to search and replace inrepl
- String to search forwith
- String to replace with
replace(String text, String repl, String with, int max)
public static String replace(String text, String repl, String with, int max)
Replace a String with another String inside a larger String,
for the first max
values of the search String.
A null
reference passed to this method is a no-op.
text
- text to search and replace inrepl
- String to search forwith
- String to replace withmax
- maximum number of values to replace, or -1
if no maximum
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |