Friday, 1 July 2011

String.Empty Vs Empty Quotes ?


The difference between string.Empty and "" is very small. String.empty will not create any object while "" will create a new object in the memory for the checking. Hence string.empty is better in memory management.
But do not forget to make a checking for null value if you are also expecting null value in the comparison.

No comments:

Post a Comment