Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Harbour Version 0.37 (c) reference Guid - Norton Guide http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]

SUBSTR()

Returns a substring from a main string
---------------------------------------------------------------------------------

 Syntax

        SUBSTR(<cString>,<nStart>[,<nLen>)] --> <cReturn>  

 Arguments

        <cString>   Character expression to be parsed      

        <nStart>    Start position      

        <nLen>      Number of characters to return    

 Returns

        <cReturn>    Substring of evaluation    

 Description

      This functions returns a character string formed from <cString>,
      starting at the position of <nStart> and continuing on for a
      lenght of <nLen> characters. If <nLen> is not specified, the value
      will be all remaining characters from the position of <nStart>.

      The value of <nStart> may be negative. If it is, the direction of
      operation is reversed from a default of left-to-right to
      right-to-left  for the number of characters specified in <nStart>.

 Examples

      FUNCTION MAIN()
      LOCAL X:=REPLICATE('ABCD',70000)

      ? QOUT(SUBSTR(X,65519,200)

      RETURN NIL
  

 Tests

      ? QOUT(SUBSTR('HELLO HARBOUR',5)
  

Status

      Ready

 Compliance

      This functions is CA CLIPPER compatible with the execption that  CA
      CLIPPER will generate an error if the passed string is >65519 bytes
      and Harbour depends of plataform.

 Platforms

      All

 Files

      Library is rtl



See Also: LEFT() AT() RIGHT()

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