substr

Synopsis

$ substr("string", start, [end])

Extracts a substring of the specified string from the specified start index up to but not including the specified end index.

Parameters

"string" - the string to grab a substring of.

start - the start index. (defaults to 0)

end - the optional end index, if not specified will default to pulling the rest of the string.

Returns

The specified substring.

Examples

$string = "abcdefghijklmnopqrstuvwxyz"; $substr = substr($string, 13, 18); println($substr);

nopqr

See Also