Click here to Skip to main content
14,237,256 members
Rate this:
Please Sign up or sign in to vote.
See more:
Let's say i have a textbox text something like this "64-66-73-64-66-61-73-64-66-61"
but i want to remove "-" so it would be like this "64 66 73 64 66 61 73 64 66 61"

What I have tried:

I have tried using this

textBox2.Text = Text.Replace("-", " ");

but then then i always get "Form2" as a result.
Updated 9-May-18 5:20am
Super Superman 9-May-18 11:17am
Shouldn't your code be: textBox2.Text = textBox2.Text.Replace("-", " ");

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

Form2 is the Text property of your form. You'll want to use textBox2.Text:

textBox2.Text = textBox2.Text.Replace("-", " ");

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100