org.mortbay.util
Class StringUtil

java.lang.Object
  |
  +--org.mortbay.util.StringUtil

public class StringUtil
extends java.lang.Object

Fast String Utilities.

Version:
$Revision: 1.3 $
Author:
Greg Wilkins (gregw)

Field Summary
static java.lang.String __ISO_8859_1
           
 
Constructor Summary
StringUtil()
           
 
Method Summary
static void append(java.lang.StringBuffer buf, java.lang.String s, int offset, int length)
          Append substring to StringBuffer
static java.lang.String asciiToLowerCase(java.lang.String s)
          fast lower case conversion.
static int indexFrom(java.lang.String s, java.lang.String chars)
          returns the next index of a character from the chars string
static java.lang.String nonNull(java.lang.String s)
          Return a non null string.
static java.lang.String replace(java.lang.String s, java.lang.String sub, java.lang.String with)
          replace substrings within string.
static java.lang.String unquote(java.lang.String s)
          Remove single or double quotes.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

__ISO_8859_1

public static java.lang.String __ISO_8859_1
Constructor Detail

StringUtil

public StringUtil()
Method Detail

asciiToLowerCase

public static java.lang.String asciiToLowerCase(java.lang.String s)
fast lower case conversion. Only works on ascii (not unicode)
Parameters:
s - the string to convert
Returns:
a lower case version of s

indexFrom

public static int indexFrom(java.lang.String s,
                            java.lang.String chars)
returns the next index of a character from the chars string

replace

public static java.lang.String replace(java.lang.String s,
                                       java.lang.String sub,
                                       java.lang.String with)
replace substrings within string.

unquote

public static java.lang.String unquote(java.lang.String s)
Remove single or double quotes.
Parameters:
s -  
Returns:
 

append

public static void append(java.lang.StringBuffer buf,
                          java.lang.String s,
                          int offset,
                          int length)
Append substring to StringBuffer
Parameters:
buf - StringBuffer to append to
s - String to append from
offset - The offset of the substring
length - The length of the substring

nonNull

public static java.lang.String nonNull(java.lang.String s)
Return a non null string.
Parameters:
s - String
Returns:
The string passed in or empty string if it is null.


Copyright © 2000 Mortbay Consulting Pty. Ltd. All Rights Reserved.