org.melati.poem.prepro
Class StringUtils

Package class diagram package StringUtils
java.lang.Object
  extended by org.melati.poem.prepro.StringUtils

public final class StringUtils
extends Object

An assortment of useful operations on Strings.


Method Summary
static void appendEscaped(StringBuffer b, String s, char e)
          Append a String to a StringBuffer, and escaping any occurances of the char in the String.
static void appendQuoted(StringBuffer b, String s, char q)
          Append a String to a StringBuffer, first quoting it with a quote character and escaping any occurances of the quote char in the String.
static String capitalised(String name)
          Captialise the first character of the input string.
static String quoted(String i, char q)
          Surround a string in quotes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

appendQuoted

public static void appendQuoted(StringBuffer b,
                                String s,
                                char q)
Append a String to a StringBuffer, first quoting it with a quote character and escaping any occurances of the quote char in the String.

Parameters:
b - the buffer to append to
s - the String to append
q - the quote character

quoted

public static String quoted(String i,
                            char q)
Surround a string in quotes.

Parameters:
i - the string to quote
q - The quote character to use
Returns:
the quoted string

appendEscaped

public static void appendEscaped(StringBuffer b,
                                 String s,
                                 char e)
Append a String to a StringBuffer, and escaping any occurances of the char in the String.

Parameters:
b - the buffer to append to
s - the String to append
e - the character to escape

capitalised

public static String capitalised(String name)
Captialise the first character of the input string.

Parameters:
name -
Returns:
the capitalised string


Copyright © 2000-2010 PanEris. All Rights Reserved.