> For the complete documentation index, see [llms.txt](https://docs.nedyx.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.nedyx.com/nedyx/clearlines-functions/text-functions/substitute.md).

# SUBSTITUTE

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

**SUBSTITUTE**(*text*; *oldText*; *newText; option*)

* *text* - the text in which to search for oldText - ***Value type**: text*
* *oldText* - the text which is to be found in parameter text - ***Value type**: text*
* *newText* - the text with which *oldText* should be replaced- ***Value type**: text*
* *option* - defines if the substitution should be done with a regular expression - ***Value type**: constant (optional, default: empty - i.e. plain text replacement)*

  Possible values are

  * *regex* - the replacement should be done using a regular expression for parameter *oldText*

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

* The *text* parameter can also be a range with several texts. The SUBSTITUTE function is then applied to all these texts.
* For the parameters *oldText* and *newText*, column ranges can be specified. The text replacement then takes place one after the other (from top to bottom) for all text pairs of these two parameters.
* The search is performed case-sensitive, so the found text within parameter *text* must have the same casing than the parameter *oldText*.

#### Examples <a href="#examples.17" id="examples.17"></a>

<figure><img src="/files/JvRHag8k0iDXKi1Wh4WP" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/1UqV5uNZBYWdivDoDQYA" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/DJSzHzXyfEWk9KSM5XC0" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/XIujddgQubVfytl5apxm" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/Cd6seqg1nQ1pFrhRdHLa" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.nedyx.com/nedyx/clearlines-functions/text-functions/substitute.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
