org.apache.tools.ant.util
Class StringUtils
java.lang.Object
org.apache.tools.ant.util.StringUtils
public final class StringUtils
extends java.lang.Object
A set of helper methods related to string manipulation.
static String | LINE_SEP - the line separator for this OS
|
static String | getStackTrace(Throwable t) - Convenient method to retrieve the full stacktrace from a given exception.
|
static Vector | lineSplit(String data) - Splits up a string into a list of lines.
|
static String | replace(String data, String from, String to) - Replace occurrences into a string.
|
static Vector | split(String data, int ch) - Splits up a string where elements are separated by a specific
character and return all elements.
|
LINE_SEP
public static final String LINE_SEP
the line separator for this OS
getStackTrace
public static String getStackTrace(Throwable t)
Convenient method to retrieve the full stacktrace from a given exception.
t
- the exception to get the stacktrace from.
- the stacktrace from the given exception.
lineSplit
public static Vector lineSplit(String data)
Splits up a string into a list of lines. It is equivalent
to split(data, '\n').
data
- the string to split up into lines.
- the list of lines available in the string.
replace
public static String replace(String data,
String from,
String to)
Replace occurrences into a string.
data
- the string to replace occurrences intofrom
- the occurrence to replace.to
- the occurrence to be used as a replacement.
- the new string with replaced occurrences.
split
public static Vector split(String data,
int ch)
Splits up a string where elements are separated by a specific
character and return all elements.
data
- the string to split up.ch
- the separator character.
Copyright B) 2000-2007 Apache Software Foundation. All Rights Reserved.