Difference between revisions of "Manuals/calci/REPLACE"
Jump to navigation
Jump to search
(6 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
− | =REPLACE( | + | <div style="font-size:30px">'''REPLACE (Old_Text,Start_Num,Num_Chars,New_Text) '''</div><br/> |
− | *where <math> | + | *where <math>Old-Text</math> is the original or old text |
− | *<math> | + | *<math>Start-Num</math> is the character position in old text |
− | *<math> | + | *<math>Num-Chars</math> is the number of characters to be replaced in old text |
− | *<math> | + | *<math>New-Text</math> is the new text that replaces the characters in old text |
− | + | **REPLACE(), replaces characters within text. | |
− | REPLACE() replaces | ||
== Description == | == Description == | ||
− | REPLACE( | + | REPLACE (Old_Text,Start_Num,Num_Chars,New_Text) |
For Example, | For Example, | ||
Line 18: | Line 17: | ||
In above example, original text is replaced with new text from 4th character to next 4 characters. | In above example, original text is replaced with new text from 4th character to next 4 characters. | ||
− | *<math> | + | *<math>Old-Text</math> and <math>New-Text</math> should be enclosed in quotes. |
− | *<math> | + | *<math>Start-Num</math> and <math>Num-Chars</math> should be positive numbers. |
− | *If <math> | + | *If <math>Start-Num</math> and <math>Num-Chars</math> are non-integers, they are truncated. |
− | *If <math> | + | *If <math>Start-Num</math> > '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. | *If any arguments are invalid, Calci displays an #ERROR message. | ||
Line 30: | Line 29: | ||
{| id="TABLE3" class="SpreadSheet blue" | {| id="TABLE3" class="SpreadSheet blue" | ||
|- class="even" | |- class="even" | ||
− | | class="ssh1_f" |ColumnA | + | | class="ssh1_f" |'''ColumnA''' |
− | | class=" " |ColumnB | + | | class=" " |'''ColumnB''' |
− | | class=" " |ColumnC | + | | class=" " |'''ColumnC''' |
|- class="odd" | |- class="odd" | ||
Line 38: | Line 37: | ||
| class=" " | | | class=" " | | ||
| class=" " | | | class=" " | | ||
− | |||
|- class="even" | |- class="even" | ||
Line 44: | Line 42: | ||
| class=" " | | | class=" " | | ||
| class=" " | | | class=" " | | ||
− | |||
|- class="odd" | |- class="odd" | ||
Line 50: | Line 47: | ||
| class=" " | | | class=" " | | ||
| class=" " | | | class=" " | | ||
− | |||
|- class="even" | |- class="even" | ||
Line 56: | Line 52: | ||
| class=" " | | | class=" " | | ||
| class=" " | | | class=" " | | ||
− | |||
|- class="odd" | |- class="odd" | ||
Line 68: | Line 63: | ||
=REPLACE(A3,6,1,"fghijk") : Replaces 6th character from old text with lower case "fghijk". Returns '''ABCDEfghijk''' 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. | =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== | ||
+ | |||
+ | {{#ev:youtube|BB-G5ucpy4I|280|center|REPLACE}} | ||
== See Also == | == See Also == | ||
Line 78: | Line 77: | ||
*[http://en.wikipedia.org/wiki/Autocorrection Find and Replace] | *[http://en.wikipedia.org/wiki/Autocorrection Find and Replace] | ||
+ | |||
+ | |||
+ | |||
+ | *[[Z_API_Functions | List of Main Z Functions]] | ||
+ | |||
+ | *[[ Z3 | Z3 home ]] |
Latest revision as of 15: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
See Also
References