ch.sahits.util
Class StringManipulator

java.lang.Object
  extended by ch.sahits.util.StringManipulator

public class StringManipulator
extends java.lang.Object

This class adds functionality to the String mehtod

Author:
Andi Hotz

Constructor Summary
StringManipulator(java.lang.String s)
          Initialize the String
 
Method Summary
 java.lang.String replace(java.lang.String toReplace, java.lang.String replaceWith)
          Replace the first occurence of toReplace with replaceWith.
 java.lang.String replaceAll(java.lang.String toReplace, java.lang.String replaceWith)
          Replace all occurrences of toReplace with replaceWith.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringManipulator

public StringManipulator(java.lang.String s)
Initialize the String

Parameters:
s -
Method Detail

replace

public java.lang.String replace(java.lang.String toReplace,
                                java.lang.String replaceWith)
Replace the first occurence of toReplace with replaceWith. If toReplace is not in the String the origianal is returned.

Parameters:
toReplace - String to be replaced
replaceWith - replacement for toReplaced
Returns:
new String with the replacement in place.

replaceAll

public java.lang.String replaceAll(java.lang.String toReplace,
                                   java.lang.String replaceWith)
Replace all occurrences of toReplace with replaceWith. If toReplace is not in the String the origianal is returned.

Parameters:
toReplace - String to be replaced
replaceWith - replacement for toReplaced
Returns:
new String with the replacement in place.