Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
18
Task/JSON/Fantom/json.fantom
Normal file
18
Task/JSON/Fantom/json.fantom
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
using util
|
||||
|
||||
class Json
|
||||
{
|
||||
public static Void main ()
|
||||
{
|
||||
Str input := """{"blue": [1, 2], "ocean": "water"}"""
|
||||
Map jsonObj := JsonInStream(input.in).readJson
|
||||
|
||||
echo ("Value for 'blue' is: " + jsonObj["blue"])
|
||||
jsonObj["ocean"] = ["water":["cold", "blue"]]
|
||||
Map ocean := jsonObj["ocean"]
|
||||
echo ("Value for 'ocean/water' is: " + ocean["water"])
|
||||
output := JsonOutStream(Env.cur.out)
|
||||
output.writeJson(jsonObj)
|
||||
echo ()
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue