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 - left() extract substring from the left end of a string http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 left()              Extract substring from the left end of a string
------------------------------------------------------------------------------
 Declaration
   string.hdr

 Syntax
   func char left extern
   param const char cString, ;
         value uint uChars

 Arguments
   cString is a character string.

   uChars is the length of the output string.

 Return
   The leftmost characters of the input string that produce the given string
   length.

 Description
   The left() function returns the specified number of characters from
   cString starting at the first character.

 Example
   #define EXAMPLE_STRING
   #include example.hdr

   proc Test_left
   ? left( "Susan Jones", 3 )              // prints "Sus"
   ? len( left( "Molly Bergen", 200 ) )    // prints 12, not 200
   ? len( left( space( 100 ), 59 ) )       // prints 59
   ? left( "   Start ", 4 )                // prints "   S"
   ? left( "Hello", 255 )                  // prints "Hello"
   ? left( "Hello", -4 )                   // prints "Hello"
   ? left( "Hello", 0   )                  // prints ""
   endproc

   proc main
   Test_left()
   endproc

See Also: right() substr()

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