fn: substr
[contents]

Contents

Syntax

The syntax for substr calls is:

f++:  
substr(string, begin, end)

n++:  
@substr(string, begin, end)

Description

The substr function takes three parameters, the first is a string and the following two are non-negative integers, it returns the substring of the first paramter beginning at the position specified in the second parameter and of length equal to the third parameter.

f++ example

Example of substr being used with f++:

:=(string, str="hello\, world!")
console(substr(str, 1, 4))

n++ example

Example of substr being used with n++:

@:=(string, str="hello\, world!")
@console(@substr(str, 1, 4))