Why don't JSONDecode turn this string into a table?

Im trying to turn a string into a table, but for some reason JSONDecode wont turn the string into a table. But it turns the string into a string.

function module.Merge(t)
	local result = ""
	for i, v in pairs(t) do
		result = result .. v
	end
	result = result..'"'
	result = game:GetService("HttpService"):JSONDecode(result)
	print(result)
	print(typeof(result))
	return result
end```
no errors comes, and when printing the typeof it prints "string"
https://gyazo.com/c5f009176b14367a9b00397b21829b5a

btw, the code above is supposed to merge tables into just 1 table, everything works fine expect for turning it back into a table.

how do i stop the code block thing

So I assume that you used JSONEncode to merge the tables into just 1 table
and you cannot decode it using the same html method?
Also, I hate you for being in the discord channel, just saying

I never JSONEncode it, am i supposed to do that? and if so, when should i?

I tough JSONDecode was just to turn a string into a table

It is not used to convert strings into table,
but instead, it is used to convert any other language into UTF8
since your string is already in UTF8, it will return the same string again.

1 Like

Oooh, how do i turn the string into a table then? everywhere is searched they used JSONEncode and JSONDecode

The JSONDecode function transforms a JSON object or array into a Lua table with the following characteristics:

  • Keys of the table are strings or numbers but not both. If a JSON object contains both, string keys are ignored.
  • An empty JSON object generates an empty Lua table {} .
  • If the input string is not a valid JSON object, this function will throw an error.

I don’t understand what you mean by converting string into table.
Can you give me an example of

yourstring = yourtable

so that I can actually see what kind of table you are trying to form by demerging.

1 Like

I sent a screenshot of the string im trying to turn into a table above. It first turns the tables into a string to merge them, but then i need to turn them back into just 1 table.

All the tables that im trying to merge was originally just 1 table that was split up.To send it over an remote event.