果然: NOTE: Microsoft Visual Basic 6.0 and later products and Microsoft Office 98 and later products come with a Replace function built-in Public Function VB5Replace(Byval MyString As String _ Byval ToFind As String, _ Byval ReplaceTo As String) As String Dim tmp As String Dim n As Integer Dim L As Integer tmp = MyString n = InStr(1, tmp, ToFind) L = Len(ToFind) Do While n tmp = Lef(tmp, n - 1) & ReplaceTo & Mid(tmp, n + L) n = InStr(n, tmp, ToFind) Loop VB5Replace = tmp End Function
VB5可能有问题!
重新安装VB5(有必要非要用VB5吗?直接安装VB6?)
找到位置,再用left、right函数截取,用&连接到新字符串,知道找不到为止
NOTE: Microsoft Visual Basic 6.0 and later products and Microsoft Office 98 and later products come with a Replace function built-in Public Function VB5Replace(Byval MyString As String _
Byval ToFind As String, _
Byval ReplaceTo As String) As String
Dim tmp As String
Dim n As Integer
Dim L As Integer tmp = MyString
n = InStr(1, tmp, ToFind)
L = Len(ToFind)
Do While n
tmp = Lef(tmp, n - 1) & ReplaceTo & Mid(tmp, n + L)
n = InStr(n, tmp, ToFind)
Loop VB5Replace = tmp
End Function