check if textbox is empty c# code example
Example 1: c# check if string is empty
if (string.IsNullOrEmpty(myString)) {
//
}
Example 2: c# check if textbox is not empty
if (String.IsNullOrEmpty(textBox1.Text))
{
// Do something...
}
Example 3: how to check if textbox is empty in c#
string.IsNullOrWhiteSpace(textBox.Text); // returns boolean