# REPLACE

The REPLACE function replaces an input text string with a given value for a specified index and length. Node references are also accepted as arguments. The index starts at 1 i.e. the first character of the input string will have an index of 1.&#x20;

### Syntax

```javascript
replace(old_string:string, index:number, length:number, replace_text:string)
```

### Arguments

old\_string- A text string.Required.&#x20;

index- A number indicating the position at which the string should be replaced.Required.&#x20;

length- A number indicating the number of characters to be replaced in the input string.Required.&#x20;

replace\_text- A text string that will replace a part/all of the old\_string parameter.Required.

### Example

```javascript
REPLACE('INFORIVER', 1, 4, 'LUMEL')
//Returns “LUMELRIVER"
```

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2FZOg76Z4EcdAQdiKuJb2L%2Fimage.png?alt=media&#x26;token=02cbdeba-df48-4841-86b2-46aada339025" alt=""><figcaption><p>Replace function</p></figcaption></figure>

### **Excel equivalent**

[**Replace**](https://support.microsoft.com/en-us/office/replace-function-8d799074-2425-4a8a-84bc-82472868878a)
