Skip to content

Latest commit

 

History

History
5 lines (3 loc) · 424 Bytes

File metadata and controls

5 lines (3 loc) · 424 Bytes

Slice/Splice Array or String

The slice operator works on both arrays and strings. Like the jq equivalent, .[10:15] will return a subarray (or substring) of length 5, starting from index 10 inclusive, up to index 15 exclusive. Negative numbers count backwards from the end of the array or string.

You may leave out the first or second number, which will refer to the start or end of the array or string respectively.