大方黄蜂

文章
5
资源
0
加入时间
3年2月3天

lua 字符串截取 存入table中

--定义测试字符串local str = "abc,123,345"splitlist = {}string.gsub(str, '[^,]+', function(w) table.insert(splitlist, w) end )--可以用过打印,看到字符串已经按照“,”截取,并且存入table中