手指精灵吧 关注:120贴子:397
  • 0回复贴,共1

强大的文本分割函数

只看楼主收藏回复

function StrSub(str, split)--字符串分割函数
local t, tmp = {}
for tmp in string.gmatch(str, "[^"..split.."]+") do
table.insert(t, tmp)
end
return t
end
A=StrSub("1--2---3----4","-")
输出后:
A[1]=1
A[2]=2
A[3]=3
A[4]=4


IP属地:广东来自Android客户端1楼2016-05-22 14:36回复