Difference between revisions of "Documentation/How Tos/Calc: REPLACE function"

From Apache OpenOffice Wiki
Jump to: navigation, search
m (Robot: Automated text replacement %s)
m
Line 13: Line 13:
 
<tt>'''REPLACE("mouse"; 2; 3; "ic")'''</tt>
 
<tt>'''REPLACE("mouse"; 2; 3; "ic")'''</tt>
 
: returns <tt>'''mice'''</tt>. Beginning at character position 2, 3 characters (<tt>'''ous'''</tt>) are removed and replaced by <tt>'''ic'''</tt>.  
 
: returns <tt>'''mice'''</tt>. Beginning at character position 2, 3 characters (<tt>'''ous'''</tt>) are removed and replaced by <tt>'''ic'''</tt>.  
 +
 +
=== Issues: ===
 +
* Excel and the forthcoming ODFF standard allow <tt>'''length'''</tt> to be zero.
  
 
{{Documentation/SeeAlso|
 
{{Documentation/SeeAlso|
Line 23: Line 26:
 
* [[Documentation/How_Tos/Calc: Functions listed alphabetically|Functions listed alphabetically]]
 
* [[Documentation/How_Tos/Calc: Functions listed alphabetically|Functions listed alphabetically]]
 
* [[Documentation/How_Tos/Calc: Functions listed by category|Functions listed by category]]}}
 
* [[Documentation/How_Tos/Calc: Functions listed by category|Functions listed by category]]}}
 
=== Issues: ===
 
* Excel and the forthcoming ODFF standard allow <tt>'''length'''</tt> to be zero.
 

Revision as of 08:16, 3 March 2009


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 forthcoming ODFF standard allow length to be zero.

Template:Documentation/SeeAlso

Personal tools