There are other functions named substr() with different numbers of arguments.
See the entire list.
substr, function
def const pure substr(source: text, start: number, count: number): text
Returns the substring of source starting at start with length count.
start: zero-based offset from the start when non-negative, or one-based
offset from the end when negative.
count: number of characters to return.
Example
source = "Hello World!"
show summary "Substrings" with
substr(source, 0, 3) as "0,3"
substr(source, -3, 2) as "-3,2"
substr(source, 6, 100) as "6,100"
substr(source, 100, 257) as "100,257"
substr(source, 2, -1) as "2,-1"
This outputs the following list:
Label
Value
0,3
Hel
-3,2
ld
6,100
World!
100,257
2,-1
Remarks
Segments that fall outside source are clipped. Negative count returns
an empty text.