我知道这是一个很奇怪的问题, 但说我有这种类型的字符串字符串表
local string_1 = "{ [name] = "string_1", [color] = "red" }"
local string_2 = "{ [name] = "string_2", [color] = "blue" }"
local string_3 = "{ [name] = "string_3", [color] = "green" }"
我可以用table.insert什么使他们成为这个
local table_1 = {
{ [name] = "string_1", [color] = "red" };
{ [name] = "string_2", [color] = "blue" };
{ [name] = "string_3", [color] = "green" };
}
我认为琴弦实际上是像' “{[名] = \” STRING_1 \ “[颜色] = \” 红\“}”'? – 2013-03-25 21:39:17
另外,你的意思是让键是变量'name'和'color'的引用,而不是字符串'name'和'color'? – 2013-03-25 21:43:34