Last Updated: February 25, 2016
·
464
· hjwu

checking white space in a textbox

bool hasAllWhitespace = txtBox1.Text.Length > 0 && txtBox1.Text.Trim().Length == 0;

Reference : C# checking white space in a textbox