> For the complete documentation index, see [llms.txt](https://docs.emobiq.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.emobiq.com/emobiq-client/006-actions-and-visual-logic/action-reference/cordova/string/replace.md).

# replace

## Description

Locate a particular set of characters or a pattern within a text and substitute it with something else.

## Input / Parameter

| Name        | Description                                                                                           | Input Type  | Default | Options | Required |
| ----------- | ----------------------------------------------------------------------------------------------------- | ----------- | ------- | ------- | -------- |
| string      | The value to be updated.                                                                              | String/Text | -       | -       | Yes      |
| replace     | The value to be replaced. It can be just a text or a regular expression (if 'regExp' is set to true). | String/Text | -       | -       | Yes      |
| replacement | The value to use as a replacement.                                                                    | String/Text | -       | -       | No       |
| regExp      | To use regular expression for the 'replace' value.                                                    | Boolean     | false   | -       | No       |

Note: See \[Regular Expression Guide] to understand regular expression more.

## Output

| Description                | Output Type |
| -------------------------- | ----------- |
| Returns the updated value. | String/Text |

## Callback

N/A

## Video

Coming soon.

## Example

The user wants to replace some words in a string.<br>

### Step

1. Call the function `console`. Call the function `replace` inside the `value` parameter of the `console` function.\
   string: I am studying.\
   replace: studying\
   replacement: working<br>

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-4dd2b6d298f9bdbd4f941edfe334c65c8bdd1d1a%2Freplace-step-1.png?alt=media)

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-85c461a1537d75b7458c8d84a3890d89391ea952%2Freplace-step-2.png?alt=media)

### Result

![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-2202a0ca5e5f3ab313293be517c3b13ce50eae27%2Freplace-result-1.png?alt=media)

## Links
