以字符串形式执行Lua代码 2015/12/14 16302 --Defining a string to use as function later funcStr = "print('test')" --Running it directly loadstring(funcStr)() --Defining a function from the string and running it func = loadstring(funcStr) func()