mirror of https://github.com/rxi/json.lua.git
Fixed README to call encode and decode in method format
parent
e1dbe93f7c
commit
aef54f5f28
|
@ -21,13 +21,13 @@ The library provides the following functions:
|
||||||
#### json.encode(value)
|
#### json.encode(value)
|
||||||
Returns a string representing `value` encoded in JSON.
|
Returns a string representing `value` encoded in JSON.
|
||||||
```lua
|
```lua
|
||||||
json.encode({ 1, 2, 3, { x = 10 } }) -- Returns '[1,2,3,{"x":10}]'
|
json:encode({ 1, 2, 3, { x = 10 } }) -- Returns '[1,2,3,{"x":10}]'
|
||||||
```
|
```
|
||||||
|
|
||||||
#### json.decode(str)
|
#### json.decode(str)
|
||||||
Returns a value representing the decoded JSON string.
|
Returns a value representing the decoded JSON string.
|
||||||
```lua
|
```lua
|
||||||
json.decode('[1,2,3,{"x":10}]') -- Returns { 1, 2, 3, { x = 10 } }
|
json:decode('[1,2,3,{"x":10}]') -- Returns { 1, 2, 3, { x = 10 } }
|
||||||
```
|
```
|
||||||
|
|
||||||
## Notes
|
## Notes
|
||||||
|
|
Loading…
Reference in New Issue