On each firing, look for instances of the pattern specified by <i>pattern</i>
in <i>stringToEdit</i> and replace them with the string given by
<i>replacement</i>. If <i>replaceAll</i> is true, then replace
all instances that match <i>pattern</i>. Otherwise, replace only
the first instance that matches. If there is no match, then the
output is the string provided by <i>stringToEdit</i>, unchanged.
The <i>pattern</i> is <b>not</b> a regular expression, to use
a regular expression, see <a href="../../../../ptolemy/actor/lib/string/StringReplace.xml">ptolemy.actor.lib.string.StringReplace</a>.
<p>
The <i>replacement</i> string, as usual with string-valued parameters
in Ptolemy II, can include references to parameter values in scope.
E.g., if the enclosing composite actor has a parameter named "x"
with value 1, say, then the replacement string a${x}b will become
"a1b".</p>
<p>Note that if the <i>pattern</i> is the two character string
<code>\r</code>, then that pattern is handled specially and
collapsed to the single character '\r'. This is for use in removing
\r's from test output.
Christopher Brooks
$Id: StringSimpleReplace.java 70402 2014-10-23 00:52:20Z cxh $
Ptolemy II 8.0
ret (cxh)
red (cxh)
The output port on which the edited string is produced.
This has type string.
The string to edit by replacing substrings that match the
specified pattern with the specified replacement. This is
a string that defaults to the empty string.
The pattern used to pattern match and replace the stringToEdit
string. It is an empty string by default.
The replacement string that replaces any matched instance of the
pattern. It is an empty string by default.