Slice (.slice())

type returns
Method `string``


name type description
A number The starting position to slice from
B number, optional The position to end the slice. If omitted this slices to the end. If negative, it will refer to the position from the end


The .slice function returns a substring from two given indexes of the original string.


"foo".slice(1, 2) == "o"
"0123".slice(0, -1) == "012"

results matching ""

    No results matching ""