- Version
- Download 53
- File Size 64.01 KB
- File Count 1
- Create Date April 25, 2016
- Last Updated April 25, 2016
Replace String in Visual Basic .Net
Replace String in Visual Basic .Net
This is a vb.net program that allows you to find a text in a given string and replace it with a string or text that you want.
The new string will be displayed in a separate textbox.
Open the project solution (.sln) in visual studio 2010/2012 or open directly the project file (.vbproj)
Source code:
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If TextBox1.Text = "" Then
MessageBox.Show("Please enter a text")
TextBox1.Focus()
Else
TextBox4.Text = Replace(TextBox1.Text, TextBox2.Text, TextBox3.Text)
End If
End Sub
End Class