com.darwinsys.lang
Class StringUtil

java.lang.Object
  extended by com.darwinsys.lang.StringUtil

public class StringUtil
extends java.lang.Object

Miscellaneous string utilities: arrayToCommaList - print an array with commas, "and"; subst - simple substitute (like 1-4's String.subst but not RE-based) .


Field Summary
static java.lang.String ENCODING_UTF_8
           
 
Constructor Summary
StringUtil()
           
 
Method Summary
static java.lang.String arrayToCommaList(java.lang.Object[] array)
          Format an array of Object as a list with commas, like "apples, oranges, and bananas");
static int indexOf(java.lang.StringBuffer sb, java.lang.String str, int fromIndex)
          Backwards-compability: StringBuffer.indexOf(String, int) added in JDK 1-4, but we need it here and one of my servers is on JDK 1-3.
static java.lang.String reverse(java.lang.String str)
          Reverse a String
static java.lang.String subst(java.lang.String oldStr, java.lang.String newStr, java.lang.String input)
          Simple string substitution (not RE-based).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ENCODING_UTF_8

public static final java.lang.String ENCODING_UTF_8
See Also:
Constant Field Values
Constructor Detail

StringUtil

public StringUtil()
Method Detail

arrayToCommaList

public static java.lang.String arrayToCommaList(java.lang.Object[] array)
Format an array of Object as a list with commas, like "apples, oranges, and bananas");


reverse

public static java.lang.String reverse(java.lang.String str)
Reverse a String


subst

public static java.lang.String subst(java.lang.String oldStr,
                                     java.lang.String newStr,
                                     java.lang.String input)
Simple string substitution (not RE-based).


indexOf

public static int indexOf(java.lang.StringBuffer sb,
                          java.lang.String str,
                          int fromIndex)
Backwards-compability: StringBuffer.indexOf(String, int) added in JDK 1-4, but we need it here and one of my servers is on JDK 1-3.



Copyright © 1996-2004 Ian F. Darwin. See license.html for usage license.