- Home
·
- Miscellaneous
·
- Searche for Specified String and Replace it with What You Want, Using Function Replace in VB6
Searche for Specified String and Replace it with What You Want, Using Function Replace in VB6
Searche for Specified String and Replace it with What You Want, Using Function Replace in VB6
Rate Searche for Specified String and Replace it with What You Want, Using Function Replace in VB6
(2(2 Vote))
'"txtTest" will be replaced by "%". Notice: only first 3 found chars will
'be replaced. For example, abababab -> %b%b%bab. If you want replace all
'char of "a", use Replace(sTest, sFirstChar, "%", 1).
Private Sub cmdReplace_Click()
'
Dim sTest As String
Dim sFirstChar As String
'
'
sTest = txtTest.Text
sFirstChar = Mid(sTest, 1, 1)
txtTest.Text = Replace(sTest, sFirstChar, "%", 1, 3)
'
End Sub
Searche for Specified String and Replace it with What You Want, Using Function Replace in VB6 Comments
No comments yet — be the first to post one!
Post a Comment