Hi everyone,

this is my first post to this forum.

Currently, I am a full time student hoping to graduate in June with a two year degree.

One of the classes I am taking is Visual Basic 2 and am having a bit of trouble with strings. Here is the click event I have so far. The red text is the problem spot. My instructor thought it should work.

Private Sub displayButton_Click(sender As System.Object, e As System.EventArgs) Handles displayButton.Click

Dim number As String
number = numberTextBox.Text.Trim

' count how many characters in the string
Dim numChars As Integer = number.Length

numChars = numChars - 1

' start loop using the total number of characters
For lp As Integer = 0 To numChars

' search string to examine if character
' is a hyphen, space or parentheses
If number.Substring(lp) Like "[- ()]" Then number = number.Remove(lp, 1)
Next

numberLabel.Text = number

End Sub


Can anyone tell me why this isn't working? I am stumped.

Thanks!

Joe.