Table of Contents

Method CreateFromText

Namespace
LMKit.Data
Assembly
LM-Kit.NET.dll

CreateFromText(string, string)

Creates a new Attachment from a plain-text string.

public static Attachment CreateFromText(string text, string name)

Parameters

text string

The textual content to encode using UTF-8.

name string

The file name to associate with the content (for example, ending with .txt).

Returns

Attachment

An Attachment carrying the provided text content.

Remarks

This method performs no I/O operations and therefore does not require an asynchronous variant.

Exceptions

ArgumentNullException

Thrown if text or name is null.