]> granicus.if.org Git - jq/commitdiff
Document `index` and `rindex` (#389)
authorNicolas Williams <nico@cryptonector.com>
Sun, 8 Jun 2014 05:00:17 +0000 (00:00 -0500)
committerNicolas Williams <nico@cryptonector.com>
Sun, 8 Jun 2014 05:00:17 +0000 (00:00 -0500)
docs/content/3.manual/manual.yml

index e64de245f0f14fb5316b47a58bf5a4a9354b8926..9023a8a98c3a7f07983184d195e13647ba1bb6ab 100644 (file)
@@ -1002,6 +1002,17 @@ sections:
             input: '{"foo": 12, "bar":[1,2,{"barp":12, "blip":13}]}'
             output: ['false']
 
+      - title: `index(s)`, `rindex(s)`
+        body: |
+
+          Outputs the index of the first (`index`) or last (`rindex`)
+          occurrence of `s` in the input.
+
+        examples:
+          - program: '[index(", "), rindex(", ")'
+            input: '"a,b, cd, efg, hijk"'
+            output: ['[3,12]']
+
       - title: `startswith`
         body: |