slice
Returns a substring of one character or series of array items beginning at the index specified by the first argument. An optional second argument specifies the length of the substring or number of array items to be returned.
String or array indices are numbered starting from 0.
Input
Output
Input
Output
Input
Output
Here the input value is an array:
Input
Output
If the first argument is a negative number, the indices are counted from the end of the string.
Input
Output
Last updated