How can I check in C# that is there a white space only in a textbox and perform some operation after that?
//SIMPLE WAY TO VALIDATE EMPTY SPACES if (txtusername.Text.Contains(" ")) { MessageBox.Show("Invalid Username"); txtusername.Clear(); txtusername.Focus(); }