String.Empty 欄位

定義

表示空字串。 此欄位為唯讀。

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

欄位值

備註

此欄位的值是長度為零的字串 「」。

在應用程式程式碼中,此欄位最常用於指派中,將字串變數初始化為空字串。 若要測試字串的值是否為 nullString.Empty ,請使用 IsNullOrEmpty 方法。

適用於

另請參閱