Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Force 4.0 Reference - $ substring comparison (binary) http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 $                   Substring comparison (binary)
------------------------------------------------------------------------------
 Syntax
   cString1 $ cString2

 Arguments
   cString1 is a character value that is searched for in cString2.
   cString2 is a character value within which cString1 is sought.

 Description
   The $ operator performs a case-sensitive substring scan and returns .t.
   if the left character string operand is contained within the right
   character operand.

 Example
   #define EXAMPLE_OPERATOR
   #include example.hdr

   vardef static
      char( 25 ) cString1 := "Hello, Force"
      char( 25 ) cString2 := "Hello"
   enddef
   
   proc Test_943
   // Is cString1 found in cString2? No, cString2 is larger than cString1.
   ? cString1 $ cString2         // prints .f.
   // Is cString2 in cString1? Yes! "Hello" is within "Hello, Force".
   ? cString2 $ cString1         // prints .t.
   endproc

   proc main
   Test_943()
   endproc

See Also: at() rat()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson