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.
コロナで文字列からcharに到達したいです。基本的に私はしたい:
local mystr = "corona" print( mystr[3] )
しかし、それは常に nil を返します。どうすればそれを達成できますか?
これは、同じ目的で使用した簡単なロジックです。これがあなたに役立つことを願っています:
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