Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

I need a key in table tostringed how do i do this?

local Table = {xd = 'Billionaire',A = 'ADMINS', O = 'ON THIS WEBSITE', I= 'IS', }

I need xd to be a string

I need to turn the keys of the table to a string

for example "xd" "A", "O"

I want them to be turned into string does anyone know how

2 comments

0

Of all the questions on this site, this one stumped me

0

Whats the usage of it?

1 answer

They are already strings.

t.a is the same as t["a"] and t.a = b is the same as t["a"] = b. The . notation is just syntactic sugar for the [""] notation, and it makes our lives easier when needing to read from a key, or write to one.

I don't know why you want this, but this can work

local keys = {}

for k in pairs(Table) do
	table.insert(keys, k)
end

print(table.concat(", ", keys))

This discussion is preserved as it was. New answers, comments, and votes are closed.