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

后端 未结 17 1845
礼貌的吻别
礼貌的吻别 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

    The above answers are technically correct, but what you may really want to use, for best code readability and least chance of an exception is String.IsNullOrEmpty(s)

提交回复
热议问题