Operator $ Foundation
Substring operator (binary): searches for a substring within another character string.
<cSubString> $ <cString>
The substring operator is used to search a character string to determine if it contains a given substring. The operator is case sensitive. It returns the value .T. (true) only when the substring <cSubString> is contained in the string <cString>. Otherwise it returns .F. (false).
Extended functionality of the substring operator
The substring operator is not restricted to values of data type Character, but can also be applied to values of type Array and Numeric.
Array
If the right operand is a value of data type Array, the operator searches the value of the left operand in the array and returns .T. (true) if the value is found, otherwise it returns .F. (false).
The right operand can be a multi-dimensional array. The operator searches all dimensions of the array. If the left operand is an array as well, the operator scans the left operand and searches the values of all array elements in the right operand.
If the left operand is of data type Character or if it contains character strings, the right operand is searched for a character string according to a simple comparison (see "=" operator). An "exactly equal" comparison is not performed (see "==" operator). Therefore, the search result depends on the SET EXACT ON|OFF setting.
Numeric
When both operands are of data type Numeric, the $ operator tests if the individual bits set in the left operand are also set in the right operand. The result is .T. (true) when all bits set for the left operand are set in the right operand.
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.