Update README.md

This commit is contained in:
overflowerror 2021-04-29 22:21:06 +02:00 committed by GitHub
parent 76955568ba
commit 051d364bd9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -126,11 +126,16 @@ object_selector := key
```
Examples:
`.foobar` will select the corresponding value for the key "foobar" from an object
`.[4]` will select the 5th (index counting starts with 0) from an array
`.[0].foo` will select the key "foo" from the first entry in an array
`.foo.bar.[0]` will select the first element in the key "bar" in the key "foo" in an object
Note: As with the `json_array_get()` and `json_object_get()` the returned value is a clone and has to be freed seperately.
### Stringify