Search code examples
c#textbox

How do I write a code that reads a text from the (textbox) and when I press my (button) it delets all DOTS in the Text?


I have 2 Textboxes. One for a text you can paste in and one that will give you the same text but without any dots in it.


Solution

  • You can write above code in single line to replace textbox value.

    private void TextBox1_TextChanged(object sender, EventArgs e)
    {
        TextBox2.Text = TextBox1.Text.Replace(".", "");
    }