This commit is contained in:
Mike Farah
2022-10-29 18:22:30 +11:00
parent d99614f55a
commit 6d6cd43255
3 changed files with 15 additions and 0 deletions
@@ -0,0 +1,5 @@
# Slice Array
The slice array operator takes an array as input and returns a subarray. Like the `jq` equivalent, `.[10:15]` will return an array of length 5, starting from index 10 inclusive, up to index 15 exclusive. Negative numbers count backwards from the end of the array.
You may leave out the first or second number, which will will refer to the start or end of the array respectively.
+5
View File
@@ -1,3 +1,8 @@
# Slice Array
The slice array operator takes an array as input and returns a subarray. Like the `jq` equivalent, `.[10:15]` will return an array of length 5, starting from index 10 inclusive, up to index 15 exclusive. Negative numbers count backwards from the end of the array.
You may leave out the first or second number, which will will refer to the start or end of the array respectively.
## Slicing arrays
Given a sample.yml file of: