Package 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 java.lang.Objectclass that provides additional functionality for replacing string
-
-
Constructor Summary
Constructors Constructor Description StringReplacer(java.lang.String str)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringreplaceString(java.lang.String toReplace, java.lang.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"voidsetReRead(boolean reRead)set the reread algorithm - if true (the default) the replaced string is checked again.
-
-
-
Method Detail
-
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 java.lang.String replaceString(java.lang.String toReplace, java.lang.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
-
-