参数 : 1:要检查的字串 [准备移除其中某些字符] 2:要移除的字符 (数字/中英文)
程序码 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
返回值 移除某些字符后的字串
实例 : 我想移除 Text1 中的字符 "A" Text1 = StringCleaner(Text1, "A")  
|