REPLACEB

Description

REPLACEB replaces part of a text string with another text string.

Syntax

REPLACEB ( orig_text, start_position, num_chars, repl_text )

 

Parameter

Description

orig_text

The original text string.

start_position

The byte position where the replacement begins. If start_position is greater than the number of bytes in orig_text, repl_text is appended to the end of orig_text. If start_position is less than 1, #VALUE! is returned.

num_chars

The number of bytes to replace. If this argument is negative, #VALUE! Is returned.

repl_text

The replacement text string.

Examples

This function returns "For the year: 1994":

REPLACEB("For the year: 1993", 18, 1, "4")

With Latin letters, one character is one byte. That is why REPLACEB and REPLACE are identical.

 Note:

If an Invalid formula syntax warning appears, check whether the comma is set as the list separator in your regional settings on the Windows Control Panel. If a different character is set as the list separator, use this character in the above examples in place of the comma. (Windows XP: Access the Windows Control Panel and select Regional and Language Options. On the Regional Options tab page, click Customize. On the Numbers tab page, check which character is the default list separator on your computer. Use this character in the above examples instead of the comma.