VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



if u want to relace a whole set of string then now u don't need to use replace command again and ag

by Rakesh Mani Tripathi (1 Submission)
Category: String Manipulation
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Sat 18th August 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)

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




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

Download this snippet    Add to My Saved Code

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 have been posted about if u want to relace a whole set of string then now u don't need to use replace command again and ag. Why not be the first to post a comment about if u want to relace a whole set of string then now u don't need to use replace command again and ag.

Post your comment

Subject:
Message:
0/1000 characters