STRING.subString

Returns a sub-string according to start and end positions.

Syntax

subString( start INTEGER, end INTEGER )
       RETURNING result STRING
  1. start is the starting position of the sub-string.
  2. end is the ending position of the sub-string.

Usage

This method returns a sub-string of the current STRING variable according to a start and end position in the original string.

If the STRING variable is NULL, or when the positions are out of bounds, the method returns NULL.

Important: When using byte length semantics, the positions are expressed in bytes, and when using char length semantincs, positions are expressed in characters.

Example

MAIN
  DEFINE s STRING
  LET s = "Some text"
  DISPLAY s.subString(6,9)
END MAIN