|
发表于 2017-9-6 20:46:28
|
显示全部楼层
回复 4# foolenough
我试过了发现写法效率太低了,我重新写了一下
Name = {};
Name.TrancelateName = function(name)
if Name.DoubleName[string.sub(name,1,4)] then
return Name.DoubleName[string.sub(name,1,4)].." "..string.gsub(string.sub(name,5,10),'(..)',Name.table)
elseif Name.DoubleName[string.sub(name,1,2)] then
return Name.DoubleName[string.sub(name,1,2)].." "..string.gsub(string.sub(name,3,10),'(..)',Name.table)
else
return string.gsub(string.sub(name,1,2),'(..)',Name.table) .." "..string.gsub(string.sub(name,3,10),'(..)',Name.table)
end
return ""
end |
|