VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Find and replace any string, text, hyperling,case sensitive option ...anything anywhere ...just 10

by [email protected] (1 Submission)
Category: String Manipulation
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Tue 4th January 2000
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Find and replace any string, text, hyperling,case sensitive option ...anything anywhere ...just 10 lines of code.Ready Snippet for your

API Declarations


'Just copy and paste in a new form the next code

Rate Find and replace any string, text, hyperling,case sensitive option ...anything anywhere ...just 10



' Feel free to use this code and come for more code in my page Http://besttops.hypermart.net
' this is marked as a String Handling/Manipulation code


Public Sub RemoveString(Entire As String, Word As String, Replace As String)
    Dim I As Integer
    I = 1
    Dim LeftPart
    Do While True
If Check1 Then
        I = InStr(1, Entire, Word) 'This is not case-sensitive:
Else
        I = InStr(1, UCase$(Entire), UCase$(Word)) 'This is case sensitive
End If
        If I = 0 Then
            Exit Do
        Else
            LeftPart = Left(Entire, I - 1)
            Entire = LeftPart & Replace & Right(Entire, Len(Entire) - Len(Word) - Len(LeftPart))
        End If
    Loop
Text1.Text = ""
    Text1.Text = Entire
End Sub

Private Sub Command2_Click()
If Text2.Text = "" Then
Exit Sub
End If
    RemoveString Text1.Text, Text2.Text, Text3.Text
On Error Resume Next
End Sub


Private Sub Form_Load()
Text1.Text = "Type the word to be Replace in Text2 and in the Text3 the Replace with text. Home page Http://besttops.hypermart.net"
End Sub


Download this snippet    Add to My Saved Code

Find and replace any string, text, hyperling,case sensitive option ...anything anywhere ...just 10 Comments

No comments have been posted about Find and replace any string, text, hyperling,case sensitive option ...anything anywhere ...just 10 . Why not be the first to post a comment about Find and replace any string, text, hyperling,case sensitive option ...anything anywhere ...just 10 .

Post your comment

Subject:
Message:
0/1000 characters