What is the difference between String and string in C#?

后端 未结 30 4654
走了就别回头了
走了就别回头了 2020-11-21 04:35

Example (note the case):

string s = \"Hello world!\";
String s = \"Hello world!\";

What are

30条回答
  •  轮回少年
    2020-11-21 05:31

    string is just an alias for System.String. The compiler will treat them identically.

    The only practical difference is the syntax highlighting as you mention, and that you have to write using System if you use String.

提交回复
热议问题