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 - strbetween() return string part between two substrings http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 strbetween()        Return string part between two substrings
------------------------------------------------------------------------------
 Declaration
   string.hdr

 Syntax
   func char strbetween extern
   param const char cString, ;
         const char cSearch1, ;
         const char cSearch2

 Arguments
   cString is a string to scan.
   cSearch1 is the first substring to search for.
   cSearch2 is the second substring to search for.

 Return
   A substring of cString that falls between the occurrences of cSearch1
   and cSearch2. An empty string is returned if either search substring
   is not found in cString.

 Description
   The strbetween() function scans a string for two passed substrings, and
   returns the middle part of the original string that falls between the
   found search substrings.

 Example
   #define EXAMPLE_STRING
   #include example.hdr

   proc Test_strbetween
   ? strbetween( "Hello nice world", "Hello ", " world" ) // print "nice"
   ? strbetween( "Hello nice world", "hello ", " world" ) // print ""
   ? strbetween( "Hello nice world", "Hello ", "none" )   // print ""
   endproc

   proc main
   Test_strbetween()
   endproc

See Also: strafter()

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