I am a beginner to VB.NET, and I am creating a program that displays a new string in a label. The new string should take a sentence entered by the user and remove every occurrence of a substring supplied by the user. This is my code so far:
Dim input As String = txtSentence.Text Dim remove As String = txtTextRemove.Text Dim index As Integer = 0 Do index = input.Remove(0, remove - 1) Loop While index > 0 Me.lblAnswer.Text = index
When I enter " I really dislike that dessert.", and I want to remove "dis". In the label I should get " I really like that dessert." but instead I am getting 0. Why am I getting this? NEED HELP WITH THE CODING!!