9951 explained code solutions for 126 technologies


luaConvert table to string


We'll use cjson module to convert table to string representation:

local cjson = require "cjson"
str_table = cjson.encode(table)ctrl + c
require "cjson"

load cjson module to work with JSON

str_table

will convert string representation of a table

table

table to convert to string

cjson.encode

encode given object to JSON