substr


(substr string fromPosition [ numChars ] )

This function extracts a part of the input string, starting at specified from index, and of numChars length.

Arguments

string  (string) the string to extract from
fromPosition  (integer >= 1) the start position in source string
numChars  (integer >= 0) the number of characters to read from source string; if omitted, the entire string part after fromPosition is returned

Return

string, can be empty if fromPosition is beyond the string length, or if numChars is 0

Example

(substr "Monday" 4)  "day"
(substr "Monday" 1 2)  "Mo"

Remarks

the first character is specified as index 1



©  Bricsys NV. All rights reserved.