Check for empty string using length property of the string variable





2.00/5 (1 vote)
Most of the developers use string.Empty to check the empty string. Instead we can check and compare the length property is zero to know the string value is empty or not.
This will increases the performance :thumbsup:
Example:
string empName = txtEmployeeName.Text;
if(empName.Length <= 0)
Response.Write("Employee name is empty");