# REPLACE

Spread for WinForms provides advanced software components that support Excel import/export, full cell customization, an extensive calculation engine with over 450 functions and more, all with zero dependencies on Excel.

## Content



This function replaces part of a text string with a different text string.

## Syntax

REPLACE(*old\_text*,*start\_char*,*num\_chars*,*new\_text*)

## Arguments

This function has these arguments:

| **Argument** | **Description** |
| -------- | ----------- |
| *old\_text* | Original text in which you want to replace characters |
| *start\_char* | Starting position in the original text to begin the replacement |
| *num\_chars* | Number of characters in the original text that you want to replace with characters from the new text; if not an integer, the number is truncated |
| *new\_text* | New text that replaces characters in the original text |

## Remarks

Use this function to replace a specified number of characters in a specified location with other characters. Use the [SUBSTITUTE](/spreadnet/docs/latest/online-formula/formulas-functionsall/formulas-functsRtoS/FunctionSUBSTITUTE) function to replace specific text with other text.

## Data Types

Accepts string data for the *old\_text* argument, numeric data for the *start\_char* argument, numeric data for the *num\_chars* argument, and string data for the *new\_text* argument. Returns string data.

## Examples

This example replaces three characters with one character, starting with the sixth character in the provided text:
`REPLACE("abcdefghijk", 6, 3, "%")` gives the result abcde%ijk

## Version Available

This function is available in product version 1.0 or later.

## See Also

[FIND](/spreadnet/docs/latest/online-formula/formulas-functionsall/formulas-functsDtoG/FunctionFIND) \| [SUBSTITUTE](/spreadnet/docs/latest/online-formula/formulas-functionsall/formulas-functsRtoS/FunctionSUBSTITUTE) \| [Text Functions](/spreadnet/docs/latest/online-formula/formulas-overview/formulas-functs/formulas-functtypes/formulas-functstext)