
StringCompare |
ptolemy.actor.lib.string.StringCompare |
Compare two strings specified either as inputs or parameters. The output
is either true or false, depending on whether the comparison function is
satisfied. The comparison functions are:
- equals: Output true if the strings are equal (Default).
- startsWith: Output true if firstString starts with
secondString.
- endsWith: Output true if firstString ends with
secondString.
- contains: Output true if firstString contains
secondString.
The strings to be compared will be taken from the inputs if they are
available, and otherwise will be taken from the corresponding parameters.
Author(s): Vinay Krishnan, Daniel Lázaro Cuadrado (contributor: Edward A. Lee)
Version:$Id: StringCompare.java,v 1.17 2005/07/08 19:56:37 cxh Exp $
Pt.Proposed Rating:Green (kapokasa)
Pt.Accepted Rating:Green (net)
output
The output port for the result of type BooleanToken.
function
The comparison function to be performed. The choices are:
- equals: Compares firstString to another secondString
(Default).
- startsWith: Tests whether firstString starts with
secondString.
- endsWith: Tests whether firstString ends with secondString.
- contains: Tests whether firstString contains secondString.
firstString
The input PortParameter for the first string of type string.
ignoreCase
The parameter to state whether to ignore case. This is a
boolean that defaults to false.
secondString
The input PortParameter for the second string of type string.