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

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

Example (note the case):

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

What are

30条回答
  •  天命终不由人
    2020-11-21 05:36

    C# is a language which is used together with the CLR.

    string is a type in C#.

    System.String is a type in the CLR.

    When you use C# together with the CLR string will be mapped to System.String.

    Theoretically, you could implement a C#-compiler that generated Java bytecode. A sensible implementation of this compiler would probably map string to java.lang.String in order to interoperate with the Java runtime library.

提交回复
热议问题