javatools.util
Class SubstituteVariable
java.lang.Object
|
+--javatools.util.SubstituteVariable
- public class SubstituteVariable
- extends java.lang.Object
A utility class for substituting parts of Strings
e.g.
SubstituteVariable("${xx} brown fox jumped over ${xx} lazy dog",
"${xx}", "the", 1); =>>
"the quick brown fox jumped over ${xx} lazy dog"
SubstituteVariable("${xx} brown fox jumped over ${xx} lazy dog",
"${xx}", "the"); =>>
"the quick brown fox jumped over the lazy dog"
Method Summary |
static java.lang.String |
substitute(java.lang.String str,
java.lang.String variable,
java.lang.String value)
|
static java.lang.String |
substitute(java.lang.String str,
java.lang.String variable,
java.lang.String value,
int num)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SubstituteVariable
public SubstituteVariable()
substitute
public static java.lang.String substitute(java.lang.String str,
java.lang.String variable,
java.lang.String value)
- Parameters:
str
- String in which to do the substitutionsvariable
- The pattern to match and replacevalue
- The string to substitute into the string
substitute
public static java.lang.String substitute(java.lang.String str,
java.lang.String variable,
java.lang.String value,
int num)
- Parameters:
str
- String in which to do the substitutionsvariable
- The pattern to match and replacevalue
- The string to substitute into the string