I have the following line of code
Dim a As String = ""
and the Refactor suggests replacing the "" with String.Empty
It is a kind of Reafactoring but why? Since i am a newbie in the future declarations of mine should i better use the String.Empty ?
It’s mostly a matter of preference really. Personally, I find String.Empty more clearly shows the programmer’s intent (for example, that he didn’t accidentally put an empty string instead of a space)… that’s probably why “Refactor” suggests it. But other than that, they’re exactly the same thing. Do as you see fit on this one.