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 - len() return the length of a string http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 len()               Return the length of a string
------------------------------------------------------------------------------
 Declaration
   string.hdr

 Syntax
   func uint len extern
   param const char cString

 Arguments
   cString is a character string.

 Return
   Length of the input string.

 Description
   The len() function returns the length of cString. The length of a
   string is determined by the position of the NULL character in the string
   versus the declared size of the string.

 Example
   #define EXAMPLE_STRING
   #include example.hdr

   proc Test_len
   vardef
       char( 90 ) cString
   enddef
   // len() returns the length of the current value of a string, not its
   // declared width
   cString := "this"
   ? len( cString )                  // prints 4
   
   ? len("Melanie Neale")            // prints 13
   ? len("")                         // prints 0
   ? len(space(40))                  // prints 40
   endproc

   proc main
   Test_len()
   endproc

See Also: isempty()

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