Hi IRF users, i am asking a little bit help how i can format my JSON data readable by human?
something like this:

link of the above ss is here: http://regex.info/code/JSON.lua
for now what i do is i create a loop to remove and replace:
filter = {"{", "}", ",", "},"}
for k,v in pairs (filter) do
tFilter = String.Find(x, v, 1, false)
if v == "{" then
x = String.Replace(x, v, "{\r\n ", false);
end
if v == "}" then
x = String.Replace(x, v, "\r\n }", false);
end
if v == "," then
x = String.Replace(x, v, ",\r\n ", false);
end
if v == "}," then
x = String.Replace(x, v, "},\r\n ", false);
end
end
i know there is another way like in my screenshot, anyone can help? Thank you so much...
telco
something like this:
link of the above ss is here: http://regex.info/code/JSON.lua
for now what i do is i create a loop to remove and replace:
filter = {"{", "}", ",", "},"}
for k,v in pairs (filter) do
tFilter = String.Find(x, v, 1, false)
if v == "{" then
x = String.Replace(x, v, "{\r\n ", false);
end
if v == "}" then
x = String.Replace(x, v, "\r\n }", false);
end
if v == "," then
x = String.Replace(x, v, ",\r\n ", false);
end
if v == "}," then
x = String.Replace(x, v, "},\r\n ", false);
end
end
i know there is another way like in my screenshot, anyone can help? Thank you so much...
telco
Comment