%SubStr function


Function
The function returns a subtext from the string given by the index of the first character and the number of characters.
Declaration
TEXT  %SubStr(
   TEXT in Text, 
   INT in idxFrom, 
   INT in numChars
 )
Parameters
textText string.
idxFromIndex of the first character in text string (from 1...).
numChars

The number of characters in the result string.

Example
%SubStr("some text", 2, 3)      ; returns the following text : "ome"
 
If the value of the parameter idxFrom overruns the string length, the function returns an invalid value. If numChars is greater than admissible number of characters, the text will be truncated:
 
%SubStr("some text", 2, 100)    ; returns the following text : "ome text"
Napíšte komentár