org.apache.mailet.base
Class StringUtils

java.lang.Object
  extended by org.apache.mailet.base.StringUtils

public final class StringUtils
extends java.lang.Object

Collects useful string utility methods.


Method Summary
static java.lang.String capitalizeWords(java.lang.String data)
          Capitalizes each word in the given text by converting the first letter to upper case.
static java.lang.String md5(java.lang.String message)
          Creates an MD5 digest from the message.
static java.lang.String[] split(java.lang.String text, java.lang.String pattern)
          Splits a string given a pattern (regex), considering escapes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

split

public static java.lang.String[] split(java.lang.String text,
                                       java.lang.String pattern)
Splits a string given a pattern (regex), considering escapes.

For example considering a pattern "," we have: one,two,three => {one},{two},{three} one\,two\\,three => {one,two\\},{three}

NOTE: Untested with pattern regex as pattern and untested for escape chars in text or pattern.


md5

public static java.lang.String md5(java.lang.String message)
Creates an MD5 digest from the message. Note that this implementation is unsalted.

Parameters:
message - not null
Returns:
MD5 digest, not null

capitalizeWords

public static java.lang.String capitalizeWords(java.lang.String data)
Capitalizes each word in the given text by converting the first letter to upper case.

Parameters:
data - text to be capitalize, possibly null
Returns:
text with each work capitalized, or null when the text is null


Copyright © 2008-2009 The Apache Software Foundation. All Rights Reserved.