- myString == String.Empty;
- myString == "";
- myString.Length == 0;
As the name probably gives away, the most efficient method is 3. myString.Length == 0; Or alternatively we can use the String.IsNullOrEmpty() method to test that the string isn't null at the same time.
No comments:
Post a Comment