分割中英文的原理和上面相似,简单的示例:
dim s as string
s="abc中国vass"
dim i as long
dim chs as string
chs=""
dim ens as string
ens=""
dim temps as string
for i=1 to len(s)
temps=mid(s,i,1)
if asc(temps)<0 then
chs=chs+temps
else
ens=ens+temps
end if
next
debug.print "中文:"+chs
debug.print "英文:"+ens
简单的示例:
dim s as string
s="abc中国vass"
dim i as long
dim temps as string
for i=1 to len(s)
temps=mid(s,i,1)
if asc(temps)<0 then
debug.print "第"+cstr(i)+"个字符为中文"
else
debug.print "第"+cstr(i)+"个字符为英文"
end if
next