I am bit confused between the below three ways to clear the contents of a textbox. I am working with WPF and found All are working, but I am unable to find the difference.
txtUserName.Clear();
This code clears the textbox. It will set the Textbox value to ""
txtUserName.Text = string.Empty;
Doesn't create object. This executes faster than txtUserName.Text = "";
txtUserName.Text = ""
txtUserName.Text = "";
Creates object and affects the performance.