|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.ecf.core.util.StringUtils
public final class StringUtils
The StringUtils class provides static methods that helps make string manipulation easy. The primary functionality it is meant to provide is the ability to split a string into a string array based on a given delimiter. This functionality is meant to take the place of the split(String) and split(String, int) method that was introduced in J2SE-1.4. Please note, however, that the splitting performed by this class simply splits the string based on the delimiter and does not perform any regular expression matching like the split methods provided in J2SE-1.4.
Constructor Summary | |
---|---|
StringUtils()
|
Method Summary | |
---|---|
static boolean |
contains(java.lang.String string,
java.lang.String target)
Returns whether the first parameter contains the second parameter. |
static java.lang.String |
replaceAll(java.lang.String string,
java.lang.String target,
java.lang.String replace)
Returns the string resulting from replacing all occurrences of the target with the replace string. |
static java.lang.String |
replaceAllIgnoreCase(java.lang.String string,
java.lang.String target,
java.lang.String replace)
Returns the string resulting from replacing all occurrences of the target with the replace string. |
static java.lang.String |
replaceFirst(java.lang.String string,
java.lang.String target,
java.lang.String replace)
Returns the string resulting from replacing the first occurrences of the target with the replace string. |
static java.lang.String[] |
split(java.lang.String string,
char character)
|
static java.lang.String[] |
split(java.lang.String string,
java.lang.String delimiter)
|
static java.lang.String[] |
split(java.lang.String string,
java.lang.String delimiter,
int limit)
|
static java.lang.String[] |
splitOnSpace(java.lang.String string)
|
static java.lang.String |
splitSubstring(java.lang.String string,
java.lang.String delimiter,
int pos)
|
static java.lang.String |
xmlDecode(java.lang.String string)
|
static java.lang.String |
xmlEncode(java.lang.String string)
|
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 final java.lang.String[] splitOnSpace(java.lang.String string)
public static final java.lang.String[] split(java.lang.String string, char character)
public static final java.lang.String[] split(java.lang.String string, java.lang.String delimiter)
public static final java.lang.String[] split(java.lang.String string, java.lang.String delimiter, int limit)
public static final java.lang.String splitSubstring(java.lang.String string, java.lang.String delimiter, int pos)
public static final java.lang.String xmlDecode(java.lang.String string)
public static final java.lang.String xmlEncode(java.lang.String string)
public static boolean contains(java.lang.String string, java.lang.String target)
string
- must not be .
target
- must not be null.
Returns:
true if the target is contained within the string.
replaceAll
public static java.lang.String replaceAll(java.lang.String string,
java.lang.String target,
java.lang.String replace)
- Returns the string resulting from replacing all occurrences of the target with the replace
string. Note that the target matches literally, and this is not the same behavior as the
String.replaceAll, which uses regular expressions for doing the matching.
- Parameters:
string
- the start string. Must not be null
.target
- the target to search for in the start string. Must not be null
.replace
- the replacement string to substitute when the target is found. Must not be null
.
- Returns:
- String result. Will not be
null
. If target is not found in the given string,
then the result will be the entire input string.
replaceAllIgnoreCase
public static java.lang.String replaceAllIgnoreCase(java.lang.String string,
java.lang.String target,
java.lang.String replace)
- Returns the string resulting from replacing all occurrences of the target with the replace
string. Note that the target matches literally but ignoring the case, and this is not the same behavior as the
String.replaceAll, which uses regular expressions for doing the matching.
- Parameters:
string
- the start string. Must not be null
.target
- the target to search for in the start string. Must not be null
.replace
- the replacement string to substitute when the target is found. Must not be null
.
- Returns:
- String result. Will not be
null
. If target is not found in the given string,
then the result will be the entire input string. - Since:
- 2.1
- See Also:
but case insensitive
replaceFirst
public static java.lang.String replaceFirst(java.lang.String string,
java.lang.String target,
java.lang.String replace)
- Returns the string resulting from replacing the first occurrences of the target with the replace
string. Note that the target matches literally, and this is not the same behavior as the
String.replaceAll, which uses regular expressions for doing the matching.
- Parameters:
string
- the start string. Must not be null
.target
- the target to search for in the start string. Must not be null
.replace
- the replacement string to substitute when the target is found. Must not be null
.
- Returns:
- String result. Will not be
null
. If target is not found in the given string,
then the result will be the entire input string. - Since:
- 3.0
Overview
Package
Class
Use
Tree
Deprecated
Index
Help
PREV CLASS
NEXT CLASS
FRAMES
NO FRAMES
All Classes
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD