String.Empty 欄位

定義

代表空字串。 此欄位僅供讀取。

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

欄位值

備註

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

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

適用於

另請參閱