Photo by Bozhin Karaivanov on Unsplash

The Empty String in C#

Michael Moreno
Nerd For Tech
Published in
3 min readSep 18, 2021

--

I recently posed the following question to my team:

Which representation of the empty string do we prefer for our project?:

A) ""

B) string.Empty

I brought this question up because we decided to use StyleCop Analyzers, which has a rule encouraging developers to prefer string.Empty over "". But rather than just blindly following what the linter…

--

--