C#中string.Empty和String.Empty之间的区别

Kal*_*tel 1 c# string

C#中string.Empty和String.Empty有什么区别?还要注意颜色是不同的.它们都引用或类型为System.String类

在此输入图像描述

Joh*_*Woo 5

这是相同的.string是类的别名System.String.

一些常见的别名:

object  ==>  System.Object
string  ==>  System.String
bool    ==>  System.Boolean
int     ==>  System.Int32
float   ==>  System.Single
double  ==>  System.Double
decimal ==>  System.Decimal
char    ==>  System.Char
Run Code Online (Sandbox Code Playgroud)