摘要: string.split=function(s,p)localrt={}string.gsub(s,'[^'..p..']+',function(w)table.insert(rt,w)end)returnrtend使用例子一localstr='abc,123,hello,ok'locallist=string.split(str,',')for_,sinipairs(list)doprint(s)end结果:abc123hellook使用例子二localstr='abc\n123\thellook'localli 阅读全文
posted @ 2013-09-24 12:48 sierllen 阅读(587) 评论(0) 推荐(0) 编辑