How to pack array into a string

You can write your topic however you want, but you need to answer these questions:

  1. **What do you want to achieve?

I would like to pack an array into a string(So I can read it). Table is blank, It uses an iterator function to insert entries.
2. What is the issue?
Can’t think of any way to input this table into a string. I need it to output like this: {“rbxassetid://758372534”, more assets, more assets, more}
3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
Yes, but I could not find any
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

local assetcache = {}
for _, v in pairs(workspace.HangoutFloor1:GetDescendants()) do
	if v:IsA("FileMesh") then
		if v.TextureId and v.MeshId then
			table.insert(assetcache, v.MeshId)
			table.insert(assetcache, v.TextureId)
		elseif v.TextureId == nil and v.MeshId then
			table.insert(assetcache, v.MeshId)
		end
	elseif v:IsA("MeshPart") then
		if v.TextureID and v.MeshId then
			table.insert(assetcache, v.MeshId)
			table.insert(assetcache, v.TextureID)
		elseif v.TextureID == nil and v.MeshId then
			table.insert(assetcache, v.MeshId)
		end
	elseif v:IsA("Decal") or v:IsA("Texture") then
		if v.Texture then
			table.insert(assetcache, v.Texture)
		end
	end
end


for _, v in pairs(assetcache) do
	print()
end

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

I think what you want is table.concat

You can convert it to a JSON table string with HttpService:JSONEncode:

local HTTPService = game:GetService("HttpService")
local Array = {"Data1", "Entry2", "Test3"}

print(HTTPService:JSONEncode(Array))
---Output
-->["Data1","Entry2","Test3"]

you want to print what’s in the table?

for index=1, #assetcache do
    print(assetcache[index])
end

if u wanna put in a string then add a local str = “” before the loop and instead of print do

 str = str .. assetcache[index]