| xHarbour Reference Documentation > Operator Reference |
![]() |
![]() |
Substring operator (binary): search substring in string.
<cSubString> $ <cString> <xExp> $ <aArray>
The substring operator performs a case-sensitive search and returns .T. (true) when <cSubString> is found in <cString>, otherwise the result is .F. (false).
The $ operator can also be used to search for a given value within any Array.
| See also: | <, <=, <> != #, = (comparison), ==, >, >=, IN, HAS, LIKE |
| Category: | Character operators , Comparison operators , Operators |
| DLL: | xhbdll.dll |
// The example demonstrates a case-sensitive search.
PROCEDURE Main()
LOCAL cString := "xHarbour"
? "X" $ cString // result: .F.
? "arb" $ cString // result: .T.
? 1 $ { 3, 2, 1 } // result: .T.
RETURN
http://www.xHarbour.com