JsonElement.GetString 方法

定义

获取元素的值(String 形式)。Gets the value of the element as a String.

public:
 System::String ^ GetString();
public string? GetString ();
public string GetString ();
member this.GetString : unit -> string
Public Function GetString () As String

返回

String

元素的值(String 形式)。The value of the element as a String.

例外

此值的 ValueKind 既不是 String,也不是 NullThis value's ValueKind is neither String nor Null.

已释放父级 JsonDocumentThe parent JsonDocument has been disposed.

注解

此方法不会创建 JSON 字符串以外的值的字符串表示形式。This method does not create a string representation of values other than JSON strings.

适用于