net.mtu.eggplant.util
Class StringUtils

java.lang.Object
  extended by net.mtu.eggplant.util.StringUtils

public final class StringUtils
extends Object

Some handy utilities for working with strings.

Version:
$Revision$

Method Summary
static String searchAndReplace(String source, String search, String replace)
          Replace all instances of search in source with replace.
static String trimString(String name, int len)
          If the string is longer than len, truncate it and append "..."
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

searchAndReplace

public static String searchAndReplace(String source,
                                      String search,
                                      String replace)
Replace all instances of search in source with replace.

Returns:
new String
PreConditions
(source != null), (search != null), (replace != null)

trimString

public static String trimString(String name,
                                int len)
If the string is longer than len, truncate it and append "..."

Parameters:
name - the string
len - the max length for the string
Returns:
the string never longer than len characters