- Home
·
- String Manipulation
·
- Another way to find and replace all instances of one string in another (non case-sensitive)
Another way to find and replace all instances of one string in another (non case-sensitive)
Another way to find and replace all instances of one string in another (non case-sensitive)
Rate Another way to find and replace all instances of one string in another (non case-sensitive)
(2(2 Vote))
Dim I As Integer
I = 1
Dim LeftPart
Do While True
I = InStr(1, Ucase$(Entire), Ucase$(Word))
'This is case sensitive. To make it not case-sensitive:
'I = InStr(1, Entire, Word)
If I = 0 Then
Exit Do
Else
LeftPart = Left(Entire, I - 1)
Entire = LeftPart & Right(Entire, Len(Entire) - Len(Word) - Len(LeftPart))
End If
Loop
MsgBox Entire
End Sub
Public Sub Form_Load()
RemoveString "StringToSearch", "WordToRemove"
End Sub
Another way to find and replace all instances of one string in another (non case-sensitive) Comments
No comments yet — be the first to post one!
Post a Comment