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...") |
m (Text replacement - "^" to "{{deprecated}}") |
||
Line 1: | Line 1: | ||
__NOTOC__ | {{deprecated}}__NOTOC__ | ||
Extracts the substring from ''string'' that begins at the ''n''th character and is of length ''len''. | Extracts the substring from ''string'' that begins at the ''n''th character and is of length ''len''. | ||
Latest revision as of 18:13, 13 September 2022
This Wiki is deprecated and we are are currrently migrating remaining pages into product documentation (Admin Guide, NXSL Guide) |
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"