# REPLACEB

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 (based on specified number of bytes).

## Syntax

REPLACEB(*old\_text*,*start\_char*,*num\_bytes*,*new\_text*)

## Arguments

This function has the following arguments:

| **Argument** | **Description** |
| -------- | ----------- |
| *old\_text* | Refers to the original text in which you want to replace characters. |
| *start\_char* | Refers to the starting position in the original text to begin the replacement. |
| *num\_bytes* | Refers to the number of bytes in the original text that you want to replace with characters from the new text. If this function is not an integer, the number is truncated. |
| *new\_text* | Refers to the new text that replaces characters in the original text. |

## Remarks

The REPLACEB function counts 2 bytes per character, but this happens only when a DBCS language is set as the default language.

## Data Types

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

## Examples

`REPLACEB("lovely",1,3,"lo")` gives the result loely.
`REPLACEB("rosy",1,3,"!")` gives the result !y.

## Version Available

This function is available in Spread for Windows Forms 11.0 or later.