Mega Code Archive

 
Categories / VB.Net / Data Types
 

Replace the string occurance

Imports System Public Class MainClass     Shared Sub Main()         'Declare variables         Dim strData As String         Dim strNewData As String         'Get the text from the TextBox         strData = "Hello You"         'Replace the string occurance         strNewData = strData.Replace("Hello", "Goodbye")         'Display the new string         System.Console.WriteLine(strNewData)     End Sub End Class