# MosText

The MosText object provides access to character-to-byte encoding and string formatting.

### Methods

| **Name**                  | **Description**                                                                                                                                                         |
| ------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| asciiToBytes(inputString) | Converts input ASCII string to byte array.                                                                                                                              |
| bytesToAscii(byteArray)   | Converts input byte array to ASCII string.                                                                                                                              |
| utf8ToBytes(inputString)  | Converts input UTF8 string to byte array.                                                                                                                               |
| bytesToUtf8(byteArray)    | Converts input byte array to UTF8 string.                                                                                                                               |
| utf16ToBytes(inputString) | Converts input UTF16 string to byte array.                                                                                                                              |
| bytesToUtf16(byteArray)   | Converts input byte array to UTF16 string.                                                                                                                              |
| utf32ToBytes(inputString) | Converts input UTF32 string to byte array.                                                                                                                              |
| bytesToUtf32(byteArray)   | Converts input byte array into UTF32 string.                                                                                                                            |
| format(inputString, args) | Formats string according to input format. Is a ported .NET [String.Format](https://docs.microsoft.com/en-us/dotnet/api/system.string.format?view=netcore-3.1) function. |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.monokot.io/scripts/api/mostext.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
