1
0
mirror of https://github.com/stedolan/jq.git synced 2024-05-11 05:55:39 +00:00

Add the range function

This commit is contained in:
Stephen Dolan
2013-05-14 16:09:10 +01:00
parent 4d540b7102
commit 81be37b236
4 changed files with 56 additions and 0 deletions

View File

@@ -588,6 +588,22 @@ sections:
- program: add
input: '[]'
output: ["null"]
- title: `range`
body: |
The `range` function produces a range of numbers. `range(4;10)`
produces 6 numbers, from 4 (inclusive) to 10 (exclusive). The numbers
are produced as separate outputs. Use `[range(4;10)]` to get a range as
an array.
examples:
- program: 'range(2;4)'
input: 'null'
output: ['2', '3']
- program: '[range(2;4)]'
input: 'null'
output: ['[2,3]']
- title: `tonumber`
body: |