instr只能返回一个子串,对于多个含子串的就无能为力了.你最好自己写吧.
如:
字符串:1234567576758
查找子串:75
for i=1 to len("1234567576758")
if mid(字符串,i,1)="7" and mid(字符串,i+1,1)="5" then
replace()
end if
next i
如:
字符串:1234567576758
查找子串:75
for i=1 to len("1234567576758")
if mid(字符串,i,1)="7" and mid(字符串,i+1,1)="5" then
replace()
end if
next i
expression 必需的。字符串表达式,包含要替换的子字符串。
find 必需的。要搜索到的子字符串。
replacewith 必需的。用来替换的子字符串。
start 可选的。在表达式中子字符串搜索的开始位置。如果忽略,假定从1开始。
count 可选的。子字符串进行替换的次数。如果忽略,缺省值是 –1,它表明进行所有可能的替换。
compare 可选的。数字值,表示判别子字符串时所用的比较方式。关于其值,请参阅“设置值”部分。
ReplaceStr 用来代替的子字符串
replace(ValStr,FindStr,ReplaceStr)