| java.lang.Object org.mortbay.util.StringUtil
StringUtil | public class StringUtil (Code) | | Fast String Utilities.
These string utilities provide both conveniance methods and
performance improvements over most standard library versions. The
main aim of the optimizations is to avoid object creation unless
absolutely required.
author: Greg Wilkins (gregw) |
Method Summary | |
public static void | append(StringBuffer buf, String s, int offset, int length) | public static void | append(StringBuffer buf, byte b, int base) | public static void | append2digits(StringBuffer buf, int i) | public static String | asciiToLowerCase(String s) fast lower case conversion. | public static boolean | endsWithIgnoreCase(String s, String w) | public static boolean | equals(String s, char[] buf, int offset, int length) | public static int | indexFrom(String s, String chars) | public static boolean | isUTF8(String charset) | public static String | nonNull(String s) Return a non null string.
Parameters: s - String The string passed in or empty string if it is null. | public static String | replace(String s, String sub, String with) replace substrings within string. | public static boolean | startsWithIgnoreCase(String s, String w) | public static String | toString(byte[] b, int offset, int length, String charset) | public static String | toUTF8String(byte[] b, int offset, int length) | public static String | unquote(String s) Remove single or double quotes. |
__LINE_SEPARATOR | final public static String __LINE_SEPARATOR(Code) | | |
append | public static void append(StringBuffer buf, String s, int offset, int length)(Code) | | Append substring to StringBuffer
Parameters: buf - StringBuffer to append to Parameters: s - String to append from Parameters: offset - The offset of the substring Parameters: length - The length of the substring |
append | public static void append(StringBuffer buf, byte b, int base)(Code) | | append hex digit
|
asciiToLowerCase | public static String asciiToLowerCase(String s)(Code) | | fast lower case conversion. Only works on ascii (not unicode)
Parameters: s - the string to convert a lower case version of s |
equals | public static boolean equals(String s, char[] buf, int offset, int length)(Code) | | |
indexFrom | public static int indexFrom(String s, String chars)(Code) | | returns the next index of a character from the chars string
|
nonNull | public static String nonNull(String s)(Code) | | Return a non null string.
Parameters: s - String The string passed in or empty string if it is null. |
toString | public static String toString(byte[] b, int offset, int length, String charset)(Code) | | |
toUTF8String | public static String toUTF8String(byte[] b, int offset, int length)(Code) | | |
|
|