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 , starting at the position of and continuing on for a lenght of characters. If is not specified, the value will be all remaining characters from the position of .
- The value of 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 .
- 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