What is the difference between String.Empty and “” (empty string)?

后端 未结 17 1822
礼貌的吻别
礼貌的吻别 2020-11-22 03:25

In .NET, what is the difference between String.Empty and \"\", and are they interchangable, or is there some underlying reference or Localization i

17条回答
  •  醉梦人生
    2020-11-22 04:00

    String.Empty is a readonly field while "" is a const. This means you can't use String.Empty in a switch statement because it is not a constant.

提交回复
热议问题