Functions

substr

Supported By

Syntax

[the] substr of ( string , offset [, length] )

substr ( string , offset [, length] )

String yields any string. Offset and length yield integers.

Description

The substr function returns length characters of the specified string starting at the specified offset. The first character of the string is at offset 1.

If no length is specified, all characters of the string starting at the specified offset are returned.

Note

If length is zero or negative, or offset is greater than the length of the string, empty is returned. If offset is zero or negative, the leftmost length+offset-1 characters of the string are returned.

See Also

mid, substring