See Also: Constrain Command, Pos Function, Uppercase Function, Lowercase function
Returns true from an expression in which the value of the second string is contained within the value of the first string.
( {host-string} contains {sub-string} )
where {host-string} is the string being parsed; and {sub-string} the string being searched for. {host-string} and {sub-string} can be either a literal or a string variable.
When the value of {sub-string} is present in the value of {host-string}, a contains expression evaluates to 1 (true), and when it is not, it evaluates to 0 (false).
string sTitle
if ((sTitle contains "engineer") OR (sTitle contains "manager")) ;
send DoCalcBonus
In this example, the procedure DoCalcBonus is called for any value of the string variable title that contains either "engineer" or "manager".
string sFruit
if (uppercase(sFruit) contains "APPLE") ;
send DoMakeCider
In this example, the procedure DoMakeCider is called whenever the value of the string variable sFruit is made up of the letters of "APPLE", regardless of their capitalization.
Contains does not support wildcard characters (* and ?). It treats these characters only as literals.
Contains does not return the position in {host-string} at which {sub-string} is found, nor the number of times it is present. The pos function may be used to determine the position of {sub-string} in {host-string}.
Contains does not recognize a match between the upper and lower cases of the same letter. The uppercase or lowercase functions may be used to disable this behavior.