
StringReplace |
ptolemy.actor.lib.string.StringReplace |
On each firing, look for instances of the pattern specified by pattern
in stringToEdit and replace them with the string given by
replacement. If replaceAll is true, then replace
all instances that match pattern. Otherwise, replace only
the first instance that matches. If there is no match, then the
output is the string provided by stringToEdit, unchanged.
The pattern is given by a regular expression.
For a reference on regular expression syntax see:
http://java.sun.com/docs/books/tutorial/extra/regex/index.html
Author(s): Antonio Yordan-Nones, Neil E. Turner, Edward A. Lee
Version:$Id: StringReplace.java,v 1.20 2005/07/08 19:56:37 cxh Exp $
Pt.Proposed Rating:Green (djstone)
Pt.Accepted Rating:Green (net)
output
The output port on which the edited string is produced.
This has type string.
stringToEdit
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.
pattern
The pattern used to pattern match and replace the stringToEdit
string. It is an empty string by default.
replaceAll
When the boolean value is true, replace all instances that match the
pattern, and when false, replace the first instance.
replacement
The replacement string that replaces any matched instance of the
pattern. It is an empty string by default.