String.Empty String.Empty String.Empty String.Empty Field

定义

表示空字符串。Represents the empty string. 此字段为只读。This field is read-only.

public: static initonly System::String ^ Empty;
public static readonly string Empty;
 staticval mutable Empty : string
Public Shared ReadOnly Empty As String 

字段值

注解

此字段的值是长度为零的字符串 ""。The value of this field is the zero-length string, "".

在应用程序代码中, 此字段最常用于赋值, 以将字符串变量初始化为空字符串。In application code, this field is most commonly used in assignments to initialize a string variable to an empty string. 若要测试字符串的值是否为nullString.Empty, 请使用IsNullOrEmpty方法。To test whether the value of a string is either null or String.Empty, use the IsNullOrEmpty method.

适用于

另请参阅