用MID函数,MID将一个汉字当作一个字处理。 dim i as integer,count as integer dim a as string,b as string dim s as string,STR as string '在字符串a中含有'B'的后面插入一个字符串b,有两处 a="adfgsdfg汉sfgh23452624B5rytsdfgsdfgw4汉5tw4rBgsdfge54t" b="ASE" for i=1 to len(a) s=mid(a,i,1) count=count+1 if s<>"B" then STR=STR & s else STR=STR & b endif next '最后形成的字符串是STR,count是统计的字数
用MID函数,MID将一个汉字当作一个字处理。
dim i as integer,count as integer
dim a as string,b as string
dim s as string,STR as string
'在字符串a中含有'B'的后面插入一个字符串b,有两处
a="adfgsdfg汉sfgh23452624B5rytsdfgsdfgw4汉5tw4rBgsdfge54t"
b="ASE"
for i=1 to len(a)
s=mid(a,i,1)
count=count+1
if s<>"B" then
STR=STR & s
else
STR=STR & b
endif
next
'最后形成的字符串是STR,count是统计的字数
在次感谢你!