Replace函数 sub sdemo3 dim BT,olrstr, newstr BT = "<BR>" oldstr= "Hello" newstr=string(3,"-")&oldstr&string(3,"-") MsgBox(newstr) newstr = replace(newstr, oldstr, Ucase(oldstr)&" World") MsgBox(newstr) newstr = Ucase(oldstr) for i=0 to 1 result =strcomp(newstr, oldstr,i) if result=0 then MsgBox(newstr &"与"&oldstr& "相等 with "&i) else MsgBox(newstr &"与"&oldstr& "不相等 with "&i) End if Next End sub
sub sdemo3
dim BT,olrstr, newstr
BT = "<BR>"
oldstr= "Hello"
newstr=string(3,"-")&oldstr&string(3,"-")
MsgBox(newstr)
newstr = replace(newstr, oldstr, Ucase(oldstr)&" World")
MsgBox(newstr)
newstr = Ucase(oldstr)
for i=0 to 1
result =strcomp(newstr, oldstr,i)
if result=0 then
MsgBox(newstr &"与"&oldstr& "相等 with "&i)
else
MsgBox(newstr &"与"&oldstr& "不相等 with "&i)
End if
Next
End sub
要是实现从“aabbcc”变成“aaecc"怎么实现呢?