Page tree
Skip to end of metadata
Go to start of metadata

%SubStr function

The function returns a subtext from the string given by the index of the first character and a number of characters.
TEXT  %SubStr(
   TEXT in Text, 
   INT in idxFrom, 
   INT in numChars

text Text string.
idxFrom Index of the first character in text string (from 1...).
numChars Number of characters in result string.

%SubStr("some text", 2, 3)      ; returns the following text : "some"

If the value of the parameter idxFrom overruns the string length, the function returns invalid value. If numChars is greater than admissible number of characters, the text is to be cut off:
%SubStr("some text", 2, 100)    ; returns the following text : "some text"

Write a comment…