# MID

#### Syntax <a href="#syntax.31" id="syntax.31"></a>

**MID**(*text*; *startPos*; *length*)

* *text* - The text from which a segment is to be returned *- **Value type**: text*
* *startPos* - The position of the first character of the segment within the text *- **Value type**: integer*
* *length* - The length of the returned segment in characters *- **Value type**: integer (optional).*

#### Remarks <a href="#remarks.25" id="remarks.25"></a>

* If *length* is not defined or *startPos* + *length* exceeds the length of the text, **MID** returns all characters after *startPos*.
* **MID** returns an empty text ("") if *startPos* is greater than the length of parameter *text* or if the parameter *length* is 0.&#x20;

#### Examples

<figure><img src="/files/8t22wHEloiInfbmBWSSs" alt=""><figcaption></figcaption></figure>


---

# 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.nedyx.com/version-1.52-preview/clearlines-functions/text-functions/mid.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.
