xHarbour Reference Documentation > Operator Reference xHarbour Developers Network  

$

Substring operator (binary): search substring in string.

Syntax

<cSubString> $ <cString>
<xExp> $ <aArray>

Arguments

<cSubString>
<cSubString> is a character value that is searched for in <cString>.
<cString>
<cString> is a character value where <cSubString> is searched in.
<xExp>
<xExp> is the expression of any type to search.
<aArray>
<aArray> is the array to scan for a matching <xExp> in.

Description

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.

Info

See also:<, <=, <> != #, = (comparison), ==, >, >=, IN, HAS, LIKE
Category: Character operators , Comparison operators , Operators
DLL:xhbdll.dll

Example

// 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

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe