Click here to Skip to main content
15,891,607 members
Please Sign up or sign in to vote.
1.00/5 (1 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.
Posted
Updated 9-May-18 5:20am
Comments
[no name] 9-May-18 11:17am    
Shouldn't your code be: textBox2.Text = textBox2.Text.Replace("-", " ");

1 solution

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

textBox2.Text = textBox2.Text.Replace("-", " ");
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900