Difference between revisions of "NXSL:substr"
Jump to navigation
Jump to search
(Created page with "__NOTOC__ Extracts the substring from ''string'' that begins at the ''n''th character and is of length ''len''. == Syntax == substr(''string'', ''n''[, ''len'']); == Para...") |
(No difference)
|
Revision as of 21:23, 2 August 2012
Extracts the substring from string that begins at the nth character and is of length len.
Syntax
substr(string, n[, len]);
Parameters
string | Source string. |
n | Starting character index for substring. The n must be a positive whole number. If n is greater than length(string), then empty string is returned. |
len | Length of substring. If you omit length, the rest of the string is returned. |
Return Value
Extracted substring.
Examples
substr("abcdef", 3, 2) -> "cd" substr("abcdef", 8) -> "" substr("abcdef", 4) -> "def"