VBGood网站全文搜索 Google

搜索VBGood全站网页(全文搜索)
首页 - 经验之谈 - 清除字符串中指定的字符
发表评论(0)作者:不详, 平台:VB6.0+Win98, 阅读:11484, 日期:2001-10-29
清除字符串中指定的字符

该函数在字符串 s 中清除 Search(注意:如果 s 为 AAABBB,Search 为 AB。如何?) :

Function StringCleaner(s As String, Search As String) As String
Dim i As Integer, res As String
res = s
Do While InStr(res, Search)
i = InStr(res, Search)
res = Left(res, i - 1) & Mid(res, i + 1)
Loop
StringCleaner = res
End Function