查找替换所选字符

2008-02-23 06:55:11来源:互联网 阅读 ()

新老客户大回馈,云服务器低至5折

Function sReplace(SearchLine As String, SearchFor As String, ReplaceWith As String)
Dim vSearchLine As String, found As Integer

found = InStr(SearchLine, SearchFor): vSearchLine = SearchLine
If found <> 0 Then
vSearchLine = ""
If found > 1 Then vSearchLine = Left(SearchLine, found - 1)
vSearchLine = vSearchLine ReplaceWith
If found Len(SearchFor) - 1 < Len(SearchLine) Then _
vSearchLine = vSearchLine Right$(SearchLine, Len(SearchLine) - found - Len(SearchFor) 1)
End If
sReplace = vSearchLine

End Function

上一篇: 翻转一个字符串
下一篇: 在TextBox中查找和继续查找

标签:

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

上一篇:在关机或Logff前信息的拦截

下一篇:Unicode与Ansi