lua 字符串截取 存入table中

xiaoxiao2021-02-27  154

--定义测试字符串

local str = "abc,123,345"

splitlist = {}

string.gsub(str, '[^,]+', function(w) table.insert(splitlist, w) end )

--可以用过打印,看到字符串已经按照“,”截取,并且存入table中

转载请注明原文地址: https://www.6miu.com/read-15023.html

最新回复(0)