.net - In C#, should I use string.Empty or String.Empty or "" to intitialize a string? -
in c#, want initialize string value empty string.
how should this? right way, , why?
string willi = string.empty;
or
string willi = string.empty;
or
string willi = "";
or what?
use whatever , team find readable.
other answers have suggested new string created every time use ""
. not true - due string interning, created either once per assembly or once per appdomain (or possibly once whole process - not sure on front). difference negligible - massively, massively insignificant.
which find more readable different matter, however. it's subjective , vary person person - suggest find out people on team like, , go consistency. find ""
easier read.
the argument ""
, " "
mistaken each other doesn't wash me. unless you're using proportional font (and haven't worked any developers do) it's pretty easy tell difference.
Comments
Post a Comment