com.pepper.platform.util
Class StringUtils

java.lang.Object
  extended by com.pepper.platform.util.StringUtils

public class StringUtils
extends Object

Utility class for string manipulation functions.


Constructor Summary
StringUtils()
           
 
Method Summary
static boolean isBlank(String theString)
          Test whether the string is null or empty
static String replace(String str, String from, String to)
          Replaces all instances of from in str with to.
static String replaceFirst(String str, String from, String to)
          Replace the first instance of from in str with to.
static String stripPrefix(String str, String prefix)
          Strip the prefix from a string.
static String trimAllWhiteSpace(String string)
          This method removes any whitespace within a string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringUtils

public StringUtils()
Method Detail

replace

public static String replace(String str,
                             String from,
                             String to)
Replaces all instances of from in str with to.

Parameters:
str - source String
from - String to be replaced
to - String to replace from with
Returns:
str with all instances of from replaced by to

trimAllWhiteSpace

public static String trimAllWhiteSpace(String string)
This method removes any whitespace within a string.

Parameters:
string - a String instance.

replaceFirst

public static String replaceFirst(String str,
                                  String from,
                                  String to)
Replace the first instance of from in str with to.

Parameters:
str - source String
from - String to be replaced
to - String to replace from with
Returns:
str with the first instance of from replaced by to.

stripPrefix

public static String stripPrefix(String str,
                                 String prefix)
Strip the prefix from a string.

Parameters:
str - String to strip
prefix - Prefix to remove from str
Returns:
str with the prefix removed.

isBlank

public static boolean isBlank(String theString)
Test whether the string is null or empty

Parameters:
theString - a String value
Returns:
a boolean value


Copyright © 2006-2007 Pepper Computer, Inc. All Rights Reserved.