com.ibm.manplato.Tools
Class StringManipulator

java.lang.Object
  |
  +--com.ibm.manplato.Tools.StringManipulator

public class StringManipulator
extends java.lang.Object

A class to provide string manipulation routines. This class only provides static methods, and thus cannot be initialized.

Version:
$Rev$-$Date: 2001/05/23 14:20:32 $$State: Exp $
Author:
File Created By: Brad BARCLAY <bbarclay@ca.ibm.com>, Last Modified By: $Author: schmidtd $

Method Summary
static java.lang.String strip(java.lang.String s)
          This method returns the substring from the first character to the first null, if one exists.
static java.lang.String substitute(java.lang.String s, java.lang.String sBefore, java.lang.String sAfter)
          This method returns a string with a substring substituted.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

strip

public static java.lang.String strip(java.lang.String s)
This method returns the substring from the first character to the first null, if one exists.
Parameters:
s - the string to strip.
Returns:
the substring of the given string up to the first null.

substitute

public static final java.lang.String substitute(java.lang.String s,
                                                java.lang.String sBefore,
                                                java.lang.String sAfter)
This method returns a string with a substring substituted. I.e. substitute("Fill %1 the blank","%1","in") will return "Fill in the blank".
Parameters:
s - the original string
sBefore - the token to remove
sAfter - the token to add
Returns:
the string with any applicable substitution(s) performed.