To Check whether to see a string is empty

There are several ways to check a string to see if it’s empty. However, you should try to always use the following method. It’s faster, and uses less resources. This may seem like a minimal piece of code -

string strAmIEmpty = "";

if (strAmIEmpty.Length == 0)

{

// empty so do something

}


But if you were checking strings through out your application, it all adds up in the end.

If you have better solution, just tell me !

0 comments: