Share via


ThreadMessageOptions.GetTextContent Method

Definition

Deserializes the underlying message content (stored as BinaryData) into a plain string.

public string GetTextContent();
member this.GetTextContent : unit -> string
Public Function GetTextContent () As String

Returns

The original text string if the content was provided in that format; otherwise, a JSON parsing error may occur.

Exceptions

Thrown if the binary content cannot be deserialized as a string (e.g., it was originally a collection of blocks).

Remarks

Use this method when you know or expect that Content was originally provided as a single plain-text string. For richer content, see GetContentBlocks().

Applies to