com.enterprisedt.util
Class StringUtils
java.lang.Object
com.enterprisedt.util.StringUtils
public class StringUtils
- extends java.lang.Object
Various useful string utilities
- Version:
- $Revision: 1.2 $
- Author:
- Bruce Blackshaw
Method Summary |
static java.lang.String |
replaceAll(java.lang.String text,
java.lang.String from,
java.lang.String to)
Replaces all occurrences of 'from' in 'text' with 'to'. |
static java.lang.String[] |
split(java.lang.String str)
Splits string consisting of fields separated by
whitespace into an array of strings. |
static java.lang.String[] |
split(java.lang.String str,
char token)
Splits string consisting of fields separated by
whitespace into an array of strings. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
StringUtils
public StringUtils()
replaceAll
public static java.lang.String replaceAll(java.lang.String text,
java.lang.String from,
java.lang.String to)
- Replaces all occurrences of 'from' in 'text' with 'to'. Used when writing code
for JDK 1.1.
- Parameters:
text
- String to replace substrings in.from
- String to search for.to
- String to replace with.
- Returns:
- String with all occurrences of 'from' substituted with 'to'.
split
public static java.lang.String[] split(java.lang.String str)
- Splits string consisting of fields separated by
whitespace into an array of strings. Yes, we could
use String.split() but this would restrict us to 1.4+
- Parameters:
str
- string to split
- Returns:
- array of fields
split
public static java.lang.String[] split(java.lang.String str,
char token)
- Splits string consisting of fields separated by
whitespace into an array of strings. Yes, we could
use String.split() but this would restrict us to 1.4+
- Parameters:
str
- string to split
- Returns:
- array of fields
Copyright (c) 2001-2007 Enterprise Distributed Technologies Ltd. All Rights Reserved.