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. 若要測試是否為字串的值是null或是String.Empty,使用IsNullOrEmpty方法。To test whether the value of a string is either null or String.Empty, use the IsNullOrEmpty method.

適用於

另請參閱