org.apache.myfaces.util
public class StringUtils extends Object
Emphasis on performance and reduced memory allocation/garbage collection in exchange for longer more complex code.
Version: $Revision: 169655 $ $Date: 2005-05-11 18:45:06 +0200 (Wed, 11 May 2005) $
Method Summary | |
---|---|
static String | dequote(String str, char quote)
Undoubles the quotes inside the string Example: hello""world becomes hello"world |
static String | dequote(String str, int begin, int end, char quote)
Undoubles the quotes inside a substring Example: hello""world becomes hello"worldWARNING: scan for quote may continue to the end of the string, make sure that either charAt(end + 1) == quote or end =
str.lentgth() . |
static String | dequoteFull(String str, char quote)
Removes the surrounding quote and any double quote inside the string Example: "hello""world" becomes hello"world |
static String | dequoteFull(String str, int begin, int end, char quote) |
static boolean | isFloatNoExponent(String str)
Checks that the string represents a floating point number that CANNOT be
in exponential notation
|
static boolean | isFloatWithOptionalExponent(String str) |
static boolean | isInteger(String str) |
static boolean | isUnsignedInteger(String str) |
static int | minIndex(int a, int b)
Returns the minimum index >= 0, if any
Use to find the first of two characters in a string: |
static String | replace(String str, String repl, String with) |
static String | replace(String str, char repl, String with) |
static StringBuffer | replace(StringBuffer out, String s, String repl, String with) |
static String[] | splitLongString(String str, char separator)
Split a string into an array of strings arround a character separator.
|
static String[] | splitLongString(String str, char separator, char quote)
Split a string into an array of strings arround a character separator.
|
static String[] | splitShortString(String str, char separator)
Split a string into an array of strings arround a character separator.
|
static String[] | splitShortString(String str, char separator, char quote)
Split a string into an array of strings arround a character separator.
|
static String | substring(String str, int begin, int end) |
static String[] | trim(String[] strings) |
hello""world becomes hello"world
Parameters: str input string to dequote quote the quoting char
Returns: dequoted string
hello""world becomes hello"worldWARNING: scan for quote may continue to the end of the string, make sure that either
charAt(end + 1) == quote
or end =
str.lentgth()
. If in doubt call
dequote(str.substring(begin, end), quote)
Parameters: str input string from which to get the substring, must not be null begin begin index for substring end end index for substring quote the quoting char
Returns: dequoted string
Throws: IllegalArgumentException if string is incorrectly quoted
"hello""world" becomes hello"world
Parameters: str input string to dequote quote the quoting char
Returns: dequoted String
Parameters: str the string to check
Returns: boolean
Use to find the first of two characters in a string:
minIndex(s.indexOf('/'), indexOf('\'))
Parameters: str the string to be split separator the separator character
Returns: array of string subparts
Parameters: str the string to be split separator the separator character quote the quote character
Returns: array of string subparts
Throws: IllegalArgumentException DOCUMENT ME!
Parameters: str the string to be split separator the separator character
Returns: array of string subparts
Parameters: str the string to be split separator the separator character quote the quote character
Returns: array of string subparts
Throws: IllegalArgumentException DOCUMENT ME!