org.apache.mailet.base
Class StringUtils

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

public final class StringUtils
extends Object

Collects useful string utility methods.


Method Summary
static String capitalizeWords(String data)
          Capitalizes each word in the given text by converting the first letter to upper case.
static String md5(String message)
          Creates an MD5 digest from the message.
static String[] split(String text, 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 String[] split(String text,
                             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 String md5(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 String capitalizeWords(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-2012 The Apache Software Foundation. All Rights Reserved.