Is there an elegant way to make whitespace string.
To be more precise, I’m looking for solution similar to following:
For an empty string I could write
string emptyString = "";
but instead I use this far more discriptive way
string emptyString = string.Empty;
Personally I prefer using
""overstring.Empty, but there’s nothing stopping you from writing a string constants class:(Note that I haven’t called it
Whitespace, as that would be ambiguous – a tab character is whitespace, for example.)Can’t say I’ve ever had much use for such a class though…