Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想从电晕中的字符串中获取一个字符。基本上我想:
local mystr = "corona" print( mystr[3] )
但它总是返回零。我怎样才能做到这一点?
这是我用于相同目的的简单逻辑。希望这可以帮助你:
local mystr = "corona" local str_tbl = {} for i=1,string.len (mystr) do str_tbl[i] = mystr:sub(i, i) print("Character in position "..i.."is:"..str_tbl[i]) end