44 lines
3.1 KiB
XML
44 lines
3.1 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<helpdocument version="1.0">
|
|
<!--
|
|
* This file is part of the LibreOffice project.
|
|
*
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
*
|
|
-->
|
|
<meta>
|
|
<topic id="calcfunc_replace" indexer="include" status="PUBLISH">
|
|
<title id="tit">REPLACE Function</title>
|
|
<filename>/text/scalc/01/func_replace.xhp</filename>
|
|
</topic>
|
|
</meta>
|
|
<body>
|
|
<bookmark branch="index" id="bm_id3149171">
|
|
<bookmark_value>REPLACE function</bookmark_value>
|
|
</bookmark>
|
|
<bookmark branch="hid/SC_HID_FUNC_ERSETZEN" id="bm_id3149990" localize="false"/>
|
|
<section id="func_replace">
|
|
<h1 id="hd_id3149171">
|
|
<variable id="replace_h1">
|
|
<link href="text/scalc/01/func_replace.xhp">REPLACE</link>
|
|
</variable>
|
|
</h1>
|
|
<paragraph id="par_id3148925" role="paragraph"><ahelp hid="HID_FUNC_ERSETZEN">Replaces part of a text string with a different text string.</ahelp> This function can be used to replace both characters and numbers (which are automatically converted to text). The result of the function is always displayed as text. If you intend to perform further calculations with a number which has been replaced by text, you will need to convert it back to a number using the <link href="text/scalc/01/04060110.xhp">VALUE</link> function.</paragraph>
|
|
</section>
|
|
<paragraph id="par_id3158426" role="paragraph">Any text containing numbers must be enclosed in quotation marks if you do not want it to be interpreted as a number and automatically converted to text.</paragraph>
|
|
<embed href="text/scalc/01/common_func.xhp#sectionsyntax"/>
|
|
<paragraph id="par_id3147286" role="code">REPLACE("Text"; Position; Length; "NewText")</paragraph>
|
|
<paragraph id="par_id3149797" role="paragraph"> <emph>Text</emph> refers to text of which a part will be replaced.</paragraph>
|
|
<paragraph id="par_id3166451" role="paragraph"> <emph>Position</emph> refers to the position within the text where the replacement will begin.</paragraph>
|
|
<paragraph id="par_id3156040" role="paragraph"> <emph>Length</emph> is the number of characters in <emph>Text</emph> to be replaced.</paragraph>
|
|
<paragraph id="par_id3159188" role="paragraph"> <emph>NewText</emph> refers to the text which replaces <emph>Text</emph>.</paragraph>
|
|
<embed href="text/scalc/01/common_func.xhp#sectionexample"/>
|
|
<paragraph id="par_id3154096" role="paragraph"> <item type="input">=REPLACE("1234567";1;1;"444")</item> returns "444234567". One character at position 1 is replaced by the complete <item type="literal">NewText</item>.</paragraph>
|
|
<section id="relatedtopics">
|
|
<tip id="par_id701677016652715"><link href="https://wiki.documentfoundation.org/Documentation/Calc_Functions/REPLACE">REPLACE wiki page</link>.</tip>
|
|
<paragraph role="paragraph" id="par_id81634670394769" localize="false"><embedvar href="text/scalc/01/04060110.xhp#head_text"/></paragraph>
|
|
</section>
|
|
</body>
|
|
</helpdocument>
|