String Replacement with recursive function
String Replacement with recursive function
Rate String Replacement with recursive function
(1(1 Vote))
You can also use VBs Replace Function
Public Function RepString(Expression As String, Find As String, Replace As String) As String
Dim i As Integer, j As Integer
For i = 1 To Len(Expression) Step Len(Find)
j = InStr(1, Expression, Find)
If j > 0 Then
RepString = Left(Expression, j - 1) & Replace & RepString(Mid(Expression, j + Len(Find)), Find, Replace)
Else
RepString = Expression
End If
Next i
End Function
String Replacement with recursive function Comments
No comments yet — be the first to post one!
Post a Comment