AutoCAD 3DMAX C语言 Pro/E UG JAVA编程 PHP编程 Maya动画 Matlab应用 Android
Photoshop Word Excel flash VB编程 VC编程 Coreldraw SolidWorks A Designer Unity3D
 首页 > VB编程

清除字符串中指定的字符

51自学网 http://www.wanshiok.com
该函数在字符串 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

007 快速交换整数
可用以下的代码快速交换两个整数(Interger):
a = a xor b
b = a xor b
a = a xor b

 

 

 
上一篇:如何用VB准确计算年龄  下一篇:巧截字符串(探讨用InStrRev函数配合Right/Left函数截取字符串)