Package com.enterprisedt.util
Class StringUtils
java.lang.Object
com.enterprisedt.util.StringUtils
Various useful string utilities
- Version:
- $Revision$
- Author:
- Bruce Blackshaw
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassstatic interfaceclass -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringreplaceAll(String text, String from, String to) Replaces all occurrences of 'from' in 'text' with 'to'.static String[]Splits string consisting of fields separated by whitespace into an array of strings.static String[]Splits string consisting of fields separated by whitespace into an array of strings.
-
Constructor Details
-
StringUtils
public StringUtils()
-
-
Method Details
-
replaceAll
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
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
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
-