I'm new here. I just want to know how to remove all numbers from a textbox when a button is clicked. For example, if textbox has text hello1, when I click the button it should be hello.
Thanks.
I'm new here. I just want to know how to remove all numbers from a textbox when a button is clicked. For example, if textbox has text hello1, when I click the button it should be hello.
Thanks.
Try this.
var output = Regex.Replace(textbox.Text, @"[\d-]","");
textBox1.Text = new string(textBox1.Text.Where(t => t <= '0' || t >= '9').ToArray());
This will also do