- Home
·
- String Manipulation
·
- if u want to relace a whole set of string then now u don't need to use replace command again and ag
if u want to relace a whole set of string then now u don't need to use replace command again and ag
if u want to relace a whole set of string then now u don't need to use replace command again and again... try this code...copy this code in
Rate if u want to relace a whole set of string then now u don't need to use replace command again and ag
(1(1 Vote))
Public Function ReplaceAll(sText As String, Optional sReplaceText As String)
Dim SpChar As String
If sReplaceText <> "" Then
If sReplaceText = "," Then
sText = Replace(sText, sReplaceText, "")
GoTo FinalText
End If
Do While sReplaceText <> ""
If InStr(1, sReplaceText, ",") <> 0 Then
SpChar = Left(sReplaceText, InStr(1, sReplaceText, ",") - 1)
Else
SpChar = sReplaceText
sReplaceText = ""
End If
sReplaceText = Mid(sReplaceText, InStr(1, sReplaceText, ",") + 1, Len(sReplaceText) - InStr(1, sReplaceText, ","))
sText = Replace(sText, SpChar, "")
Loop
End If
FinalText:
ReplaceAll = sText
End Function
if u want to relace a whole set of string then now u don't need to use replace command again and ag Comments
No comments yet — be the first to post one!
Post a Comment