STRING.subString

Returns a sub-string from start and end positions in a given string.

Syntax

subString(
     startIndex INTEGER,
     endIndex INTEGER )
   RETURNS STRING
  1. startIndex is the starting position of the sub-string.
  2. endIndex is the ending position of the sub-string.

Usage

This method returns a sub-string of the current STRING variable based on a start and end positions 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 semantics, positions are expressed in characters.

Example

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