Find one string in another, and replace them with a third string
Find one string in another, and replace them with a third string
Rate Find one string in another, and replace them with a third string
(1(1 Vote))
' By Francisco Castillo - september 2000
' Replaces the string "findStr" found in "target" with
' "replaceStr". Returns the resultant string.
FindReplace = target
' Returns "target" if no ocurrence of "FindStr" found.
p = InStr(target, findStr)
If p <> 0 Then
FindReplace = Left(target, p - 1) & replaceStr & Right(target, Len(target) - ((p - 1) + Len(findStr)))
End If
End Function
Find one string in another, and replace them with a third string Comments
No comments yet — be the first to post one!
Post a Comment