Extract a part of a String, Number, or Array.
Syntax
Parameters
subject
- The entity to slice.start
- The position to start slicing from. If start
is non-negative, the position will be calculated from the beginning of subject
, otherwise it will be calculated from the end.length
- The number of elements (characters in a String, or items in an Array) to return. If omitted, everything from start
to the end of subject
will be returned. If positive, the sequence will contain that many elements, otherwise if negative, the sequence will stop that many elements from the end of subject
.false
(default) - The keys in the Array returned will be re-assigned from 0
.true
- The original keys will be retained.
Result
Returns a sequence from subject
, defined by start
and length
.