In .NET, what is the difference between String.Empty and \"\", and are they interchangable, or is there some underlying reference or Localization i
Everybody here gave some good theoretical clarification. I had a similar doubt. So I tried a basic coding on it. And I found a difference. Here's the difference.
string str=null;
Console.WriteLine(str.Length); // Exception(NullRefernceException) for pointing to null reference.
string str = string.Empty;
Console.WriteLine(str.Length); // 0
So it seems "Null" means absolutely void & "String.Empty" means It contains some kind of value, but it is empty.