REPLACE function

From Apache OpenOffice Wiki
< Documentation‎ | How Tos
Revision as of 15:35, 2 February 2024 by DiGro (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search



REPLACE

Replaces part of a text string with a different text string.

Syntax:

REPLACE(originaltext; startposition; length; newtext)

in originaltext, removes length characters beginning at character startposition, replaces them with newtext, and returns the result.
startposition and length must be 1 or more.

Example:

REPLACE("mouse"; 2; 3; "ic")

returns mice. Beginning at character position 2, 3 characters (ous) are removed and replaced by ic.

Issues:

  • Excel and the ODFF standard allow length to be zero.



See Also

Personal tools