In .NET, which is best, mystring.Length == 0 or mystring == string.Empty?
.net, .net-3.5, conditional-statements, optimization
Solution
I prefer
String.IsNullOrEmpty(myString)
Just in case it contains a null value.
Problem
Possible Duplicate: Checking for string contents? string Length Vs Empty String In .NET, which is best, ``` if (mystring.Length == 0) ``` or ``` if (mystring == string.Empty) ``` It seems that these would have the same effect, but which would be best behind the scenes?