@FIND

The FIND function searches a source string for a provided sub-string and, depending on the context of the function call, returns one of the sub-string, the position of its first character within the source string, or an indicator as to whether or not it was located. This search can optionally be case-insensitive and may begin at the beginning of the source string or at some character position within the source string.

Note that this function no longer works with object collection properties. This functionality is now provided by the new rule function COLLECTION_FIND. Upgrades of projects from previous platform versions will be modified with the replacement of FIND with COLLECTION_FIND in any rule definition. This will happen as a part of the standard upgrade process built into the Agentry Editor and should require no additional actions on the part of the developer.

When FIND is called in a string context, the function will search a source string for a sub-string, returning that sub-string when found or an empty string if not found.

When FIND is called in an integral number context, the function will search a source string for a sub-string, returning the position of the first character of the sub-string within the source string when found, or -1 if not found. The first character of the string is at position 0.

When FIND is called in a Boolean context, the function will search a source string for a sub-string, returning true when found and false when not found.

Parameters

@FIND (Source String, Search String [, Case Sensitive [, Start Position]])
Source String
Required string parameter; contains the string value to be searched by the function.
Search String
Required string parameter; contains the string value to search for within Source String. If Search String contains more characters than Source String, no sub-string will be found.
Case Sensitive
Optional Boolean parameter; when specified, determines whether or not the search should consider or ignore case. When this parameter is true or not present, the search will be case-sensitive. When this parameter is false, case will be ignored.
Start Position
Optional integral number parameter; when specified, contains the character position within Source String to begin the search for Search String. The first character in Source String is at position 0. If this parameter is not provided, the search will always begin with the first character of Source String.

Supported Return Types

  • Boolean
  • Integral Number
  • String