敬业的IT人 >> 编程开发 >> VB >> 移除字串中不要的字符

移除字串中不要的字符

敬业的IT人 互联网 佚名 2008-4-17 17:14:26

参数:1:要检查的字串[准备移除其中某些字符]
2:要移除的字符(数字/中英文)

程序码
FunctionStringCleaner(sAsString,SearchAsString)AsString
DimiAsInteger,resAsString
res=s
DoWhileInStr(res,Search)
i=InStr(res,Search)
res=Left(res,i-1)&Mid(res,i 1)
Loop
StringCleaner=res
EndFunction

返回值移除某些字符后的字串

实例:
我想移除Text1中的字符"A"
Text1=StringCleaner(Text1,"A")

粤ICP备06119539号
Copyright CiscoSky.Org,Some Rights Reserved.
Email:me1228#tom.com