移除中文部分

 

function StrSplit(inputstr, sep)
    if sep == nil then
      sep = "%s"
    end
    local t={}
    local i=1
    for str in string.gmatch(inputstr, "([^"..sep.."]+)") do
       t[i] = str
       i = i + 1
    end
    return t
end
local a = "23245023496830,汉字。。。。"
local b = ":"
b = StrSplit(a,",")
print(b[1])

输出

23245023496830

 

posted @ 2018-11-22 11:13  anobscureretreat  阅读(162)  评论(0编辑  收藏  举报