lhf*_*lhf 38
s="How do I take the string and split it into a table of strings?"
for w in s:gmatch("%S+") do print(w) end
Run Code Online (Sandbox Code Playgroud)
pon*_*zao 15
s = "foo bar 123"
words = {}
for word in s:gmatch("%w+") do table.insert(words, word) end
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
23855 次 |
最近记录: |