In C#, I want to initialize a string value with an empty string.
How should I do this? What is the right way, and why?
string willi = string.Empty;
I was just looking at some code and this question popped into my mind which I had read some time before. This is certainly a question of readability.
Consider the following C# code...
(customer == null) ? "" : customer.Name
vs
(customer == null) ? string.empty : customer.Name
I personally find the latter less ambiguous and easier to read.
As pointed out by others the actual differences are negligible.