Difference between revisions of "Manuals/calci/REPLACE"

From ZCubes Wiki
Jump to navigation Jump to search
(Created page with "<div id="6SpaceContent" class="zcontent" align="left"> <font color="#484848"><font face="Arial, sans-serif"><font size="2">'''REPLACE'''</font></font></font><font color="#4...")
 
 
(7 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<div id="6SpaceContent" class="zcontent" align="left">
+
<div style="font-size:30px">'''REPLACE (Old_Text,Start_Num,Num_Chars,New_Text) '''</div><br/>
 +
 
 +
*where <math>Old-Text</math> is the original or old text
 +
*<math>Start-Num</math> is the character position in old text
 +
*<math>Num-Chars</math> is the number of characters to be replaced in old text
 +
*<math>New-Text</math> is the new text that replaces the characters in old text
 +
**REPLACE(), replaces characters within text.
 +
 
 +
== Description ==
 +
 
 +
REPLACE (Old_Text,Start_Num,Num_Chars,New_Text)
 +
 
 +
For Example,
 +
 
 +
REPLACE("WELCOME",4,4,"-COME") returns ''WEL-COME''
 +
 
 +
In above example, original text is replaced with new text from 4th character to next 4 characters.
  
<font color="#484848"><font face="Arial, sans-serif"><font size="2">'''REPLACE'''</font></font></font><font color="#484848"><font face="Arial, sans-serif"><font size="2">(</font></font></font><font color="#484848"><font face="Arial, sans-serif"><font size="2">'''otxt'''</font></font></font><font color="#484848"><font face="Arial, sans-serif"><font size="2">,</font></font></font><font color="#484848"><font face="Arial, sans-serif"><font size="2">'''snum'''</font></font></font><font color="#484848"><font face="Arial, sans-serif"><font size="2">,</font></font></font><font color="#484848"><font face="Arial, sans-serif"><font size="2">'''noc'''</font></font></font><font color="#484848"><font face="Arial, sans-serif"><font size="2">,</font></font></font><font color="#484848"><font face="Arial, sans-serif"><font size="2">'''ntext'''</font></font></font><font color="#484848"><font face="Arial, sans-serif"><font size="2">)</font></font></font>
+
*<math>Old-Text</math> and <math>New-Text</math> should be enclosed in quotes.
 +
*<math>Start-Num</math> and <math>Num-Chars</math> should be positive numbers.
 +
*If <math>Start-Num</math> and <math>Num-Chars</math> are non-integers, they are truncated.
 +
*If <math>Start-Num</math> &gt; 'length of <math>Old-Text</math>' , Calci assumes it to be '0'(zero) and new text is appended before old text.
 +
*If any arguments are invalid, Calci displays an #ERROR message.
  
<font color="#484848"><font face="Arial, sans-serif"><font size="2">where otx</font></font></font><font color="#484848"><font face="Arial, sans-serif"><font size="2">'''t'''</font></font></font><font color="#484848"><font face="Arial, sans-serif"><font size="2">   is text that want to replace some characters and</font></font></font>
+
== Examples ==
  
<font color="#484848"><font face="Arial, sans-serif"><font size="2">'''snum'''</font></font></font><font color="#484848"><font face="Arial, sans-serif"><font size="2">   is the position of the character in otxt and</font></font></font>
+
<div id="6SpaceContent" class="zcontent" align="left">
  
<font color="#484848"><font face="Arial, sans-serif"><font size="2">'''noc'''</font></font></font><font color="#484848"><font face="Arial, sans-serif"><font size="2">   is the number of characters in otxt and</font></font></font>
+
{| id="TABLE3" class="SpreadSheet blue"
 +
|- class="even"
 +
| class="ssh1_f" |'''ColumnA'''
 +
| class=" " |'''ColumnB'''
 +
| class=" " |'''ColumnC'''
  
<font color="#484848"><font face="Arial, sans-serif"><font size="2">ntxt  is the text that will replace characters in otxt.</font></font></font>
+
|- class="odd"
 +
| class="ssh1_f" |123456
 +
| class="  " |
 +
| class=" " |
  
</div>
+
|- class="even"
----
+
| class="ssh1_f" |replace
<div id="1SpaceContent" class="zcontent" align="left">
+
| class=" " |
 +
| class=" " |
  
<font color="#484848"><font face="Arial, sans-serif"><font size="2">'''REPLACE'''</font></font></font><font color="#484848"><font face="Arial, sans-serif"><font size="2">(</font></font></font><font color="#484848"><font face="Arial, sans-serif"><font size="2">'''otxt'''</font></font></font><font color="#484848"><font face="Arial, sans-serif"><font size="2">,</font></font></font><font color="#484848"><font face="Arial, sans-serif"><font size="2">'''snum'''</font></font></font><font color="#484848"><font face="Arial, sans-serif"><font size="2">,</font></font></font><font color="#484848"><font face="Arial, sans-serif"><font size="2">'''noc'''</font></font></font><font color="#484848"><font face="Arial, sans-serif"><font size="2">,</font></font></font><font color="#484848"><font face="Arial, sans-serif"><font size="2">'''ntext'''</font></font></font><font color="#484848"><font face="Arial, sans-serif"><font size="2">)</font></font></font>
+
|- class="odd"
 +
| class="ssh1_f" |ABCDEF
 +
| class=" " |
 +
| class=" " |
  
<font color="#484848"><font face="Arial, sans-serif"><font size="2">where otx</font></font></font><font color="#484848"><font face="Arial, sans-serif"><font size="2">'''t'''</font></font></font><font color="#484848"><font face="Arial, sans-serif"><font size="2">   is text that want to replace some characters and</font></font></font>
+
|- class="even"
 +
| class="ssh1_f" |Mango
 +
| class=" " |
 +
| class=" " |
  
<font color="#484848"><font face="Arial, sans-serif"><font size="2">'''snum'''</font></font></font><font color="#484848"><font face="Arial, sans-serif"><font size="2">   is the position of the character in otxt and</font></font></font>
+
|- class="odd"
 +
| class="ssh1_f" |
 +
| class=" " |
 +
| class=" " |
 +
|}
  
<font color="#484848"><font face="Arial, sans-serif"><font size="2">'''noc'''</font></font></font><font color="#484848"><font face="Arial, sans-serif"><font size="2">   is the number of characters in otxt and</font></font></font>
+
=REPLACE(A1,2,1,"two") : Replaces second character from old text with "two". Returns '''1two3456''' as output.
 +
=REPLACE(A2,3,5,"PLACE") :Replaces 5 characters from old text starting from 3rd position with upper case "PLACE". Returns '''rePLACE''' as output.
 +
=REPLACE(A3,6,1,"fghijk") : Replaces 6th character from old text with lower case "fghijk". Returns '''ABCDEfghijk''' as output.
 +
=REPLACE(A4,8,1,"Apple ") : Appends "Apple " before old text as snum is greater than length of old text. Returns '''Apple Mango''' as output.
  
<font color="#484848"><font face="Arial, sans-serif"><font size="2">ntxt  is the text that will replace characters in otxt.</font></font></font>
+
==Related Videos==
  
</div>
+
{{#ev:youtube|BB-G5ucpy4I|280|center|REPLACE}}
----
 
<div id="12SpaceContent" class="zcontent" align="left"><div class="ZEditBox" align="left">
 
  
REPLACE
+
== See Also ==
  
</div></div>
+
*[[Manuals/calci/REPLACEB | REPLACEB]]
----
+
*[[Manuals/calci/SUBSTITUTE | SUBSTITUTE]]
<div id="8SpaceContent" class="zcontent" align="left">
+
*[[Manuals/calci/REPT | REPT]]
  
<font color="#484848"><font face="Arial, sans-serif"><font size="2">Let’s see an example in (Column1 Row 1)</font></font></font>
+
==References==
  
<font color="#666666"><font face="Arial, sans-serif"><font size="2">I.e.C1R1 =Inspiration</font></font></font>
+
*[http://en.wikipedia.org/wiki/Autocorrection Find and Replace]
  
<font color="#666666"><font face="Arial, sans-serif"><font size="2"><nowiki>=REPLACE(C1R1,5,3,”@”) is Insp@tion</nowiki></font></font></font>
 
  
</div>
 
----
 
<div id="10SpaceContent" class="zcontent" align="left"><div class="ZEditBox" align="justify">Syntax </div><div class="ZEditBox"><center></center></div></div>
 
----
 
<div id="3SpaceContent" class="zcontent" align="left"><div class="ZEditBox" align="justify">Examples </div></div>
 
----
 
<div id="11SpaceContent" class="zcontent" align="left"><div class="ZEditBox" align="justify">Description </div></div>
 
----
 
<div id="2SpaceContent" class="zcontent" align="left">
 
  
{| id="TABLE3" class="SpreadSheet blue"
+
*[[Z_API_Functions | List of Main Z Functions]]
|- class="even"
 
| class=" " |
 
| Column1
 
| class="  " | Column2
 
| Column3
 
| Column4
 
|- class="odd"
 
| class=" " | Row1
 
| class=" " | Inspiration
 
| class="sshl_f" | Insp@tion
 
|
 
| class="                                                            sshl_f  " |
 
|- class="even"
 
| class="  " | Row2
 
| class="sshl_f" |
 
| class="sshl_f SelectTD SelectTD" |
 
<div id="2Space_Handle" title="Click and Drag to resize CALCI Column/Row/Cell. It is EZ!"></div><div id="2Space_Copy" title="Click and Drag over to AutoFill other cells."></div>
 
|
 
|
 
|- class="odd"
 
| Row3
 
| class="                                      sshl_f            " |
 
|
 
|
 
|
 
|- class="even"
 
| Row4
 
|
 
|
 
|
 
| class="  " |
 
|- class="odd"
 
| class=" " | Row5
 
|
 
|
 
|
 
|
 
|- class="even"
 
| Row6
 
|
 
|
 
|
 
|
 
|}
 
  
<div align="left">[[Image:calci1.gif]]</div></div>
+
*[[ Z3 |  Z3 home ]]
----
 

Latest revision as of 16:31, 13 August 2018

REPLACE (Old_Text,Start_Num,Num_Chars,New_Text)


  • where is the original or old text
  • is the character position in old text
  • is the number of characters to be replaced in old text
  • is the new text that replaces the characters in old text
    • REPLACE(), replaces characters within text.

Description

REPLACE (Old_Text,Start_Num,Num_Chars,New_Text)

For Example,

REPLACE("WELCOME",4,4,"-COME") returns WEL-COME

In above example, original text is replaced with new text from 4th character to next 4 characters.

  • and should be enclosed in quotes.
  • and should be positive numbers.
  • If and are non-integers, they are truncated.
  • If > 'length of ' , Calci assumes it to be '0'(zero) and new text is appended before old text.
  • If any arguments are invalid, Calci displays an #ERROR message.

Examples

ColumnA ColumnB ColumnC
123456
replace
ABCDEF
Mango
=REPLACE(A1,2,1,"two") : Replaces second character from old text with "two". Returns 1two3456 as output.
=REPLACE(A2,3,5,"PLACE") :Replaces 5 characters from old text starting from 3rd position with upper case "PLACE". Returns rePLACE as output.
=REPLACE(A3,6,1,"fghijk") : Replaces 6th character from old text with lower case "fghijk". Returns ABCDEfghijk as output.
=REPLACE(A4,8,1,"Apple ") : Appends "Apple " before old text as snum is greater than length of old text. Returns Apple Mango as output.

Related Videos

REPLACE

See Also

References