com.jfw.util
Class ReplaceText

java.lang.Object
  extended by com.jfw.util.ReplaceText

public final class ReplaceText
extends java.lang.Object

Replace a string in a string.


Constructor Summary
ReplaceText()
           
 
Method Summary
static java.lang.String replace(java.lang.String stringToConvert, java.lang.String changeThis, java.lang.String inThis)
          Replaces string by given string in given string.
static java.lang.String replace(java.lang.String stringToConvert, java.lang.String changeThis, java.lang.String inThis, java.lang.String fromHere, java.lang.String toThere)
          Replaces string by given string between two other given string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReplaceText

public ReplaceText()
Method Detail

replace

public static java.lang.String replace(java.lang.String stringToConvert,
                                       java.lang.String changeThis,
                                       java.lang.String inThis,
                                       java.lang.String fromHere,
                                       java.lang.String toThere)
Replaces string by given string between two other given string. If the parameter changeThis equals "" then will be substitute any string contained between fromHere and toThere.

Parameters:
stringToConvert - the original string.
changeThis - the string to be replaced.
inThis - the string to put.
fromHere - string from first occurance of which replacement is to be done.
toThere - string to from first occurance of which replacement is to be done.
Returns:
replaced string.

replace

public static java.lang.String replace(java.lang.String stringToConvert,
                                       java.lang.String changeThis,
                                       java.lang.String inThis)
Replaces string by given string in given string.

Parameters:
stringToConvert - the original string.
changeThis - the string to be replaced.
inThis - the string to put.
Returns:
replaced string.