NXSL:substr
Jump to navigation
Jump to search
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"