移除中文部分
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