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

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

    Since String.Empty is not a compile-time constant you cannot use it as a default value in function definition.

    public void test(int i=0,string s="")
        {
          // Function Body
        }
    

提交回复
热议问题