org.cip4.jdflib.util
Class StringUtil.StringReplacer
java.lang.Object
org.cip4.jdflib.util.StringUtil.StringReplacer
- Enclosing class:
- StringUtil
public static class StringUtil.StringReplacer
- extends Object
class that provides additional functionality for replacing string
- Author:
- rainer prosi
|
Method Summary |
String |
replaceString(String toReplace,
String replaceBy)
replace a string in a given String if the replacement string is contained by the string to replace, recursively replace until no ocurrences of the
original remain thus replaceString("a000000", "00", "0") will return "a0" rather than "a000" |
void |
setReRead(boolean reRead)
set the reread algorithm - if true (the default) the replaced string is checked again. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
StringUtil.StringReplacer
public StringUtil.StringReplacer(String str)
- Parameters:
str -
setReRead
public void setReRead(boolean reRead)
- set the reread algorithm - if true (the default) the replaced string is checked again. If false
the algorithm continues after the replacement
- Parameters:
reRead -
replaceString
public String replaceString(String toReplace,
String replaceBy)
- replace a string in a given String if the replacement string is contained by the string to replace, recursively replace until no ocurrences of the
original remain thus replaceString("a000000", "00", "0") will return "a0" rather than "a000"
- Parameters:
toReplace - String to match and replacereplaceBy - String to insert for toReplace, null if nothing should be inserted
- Returns:
- the String with replaced characters
Copyright © 2013. All Rights Reserved.