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.

適用於

另請參閱