The array
method gets the array, if the value is a JSON array.
array()
(LuaJsonArray). A LuaJsonArray object that represents the array.
local fh = io.open("example_array.json", "r") local file_content = fh:read("*all") fh:close() local myJsonValue = parse_json(file_content) if myJsonValue:is_array() then print "The value is a JSON array" local myJsonArray=myJsonValue:array() print (myJsonArray:string()) end
|