Difference between revisions of "Manuals/calci/REPLACEARRAY"

From ZCubes Wiki
Jump to navigation Jump to search
(Created page with "=REPLACEARRAY(Array,Match,Replacement)= *where <math>Array</math> is the original or old text *<math>Match</math> is the matching character in old text *<math>Replacement</ma...")
 
Line 1: Line 1:
 
=REPLACEARRAY(Array,Match,Replacement)=
 
=REPLACEARRAY(Array,Match,Replacement)=
  
*where <math>Array</math> is the original or old text
+
*where <math>Array</math> is the original or old array
*<math>Match</math> is the matching character in old text
+
*<math>Match</math> is the matching character in old array
*<math>Replacement</math> is the new text that replaces the matching characters in old text
+
*<math>Replacement</math> is the new character that replaces the matching characters in old array
  
REPLACEARRAY() replaces the characters from the original string with mentioned characters or string.
+
REPLACEARRAY() replaces the characters from the original array with mentioned characters or string.
  
  
Line 16: Line 16:
 
REPLACEARRAY("WELCOME","L","***") returns ''WE***COME''
 
REPLACEARRAY("WELCOME","L","***") returns ''WE***COME''
  
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 for the 3rd character.
  
*<math>otext</math> and <math>ntext</math> should be enclosed in quotes.
+
*<math>Array</math> can be array characters or text. Characters or text should be written in double quotes ("").
*<math>snum</math> and <math>noc</math> should be positive numbers.
+
*<math>Match</math> can be a character. If it does not match, original array is displayed as it is.
*If <math>snum</math> and <math>noc</math> are non-integers, they are truncated.
+
*Argument <math>Replacement</math> can be a single character or a string.
*If <math>snum</math> &gt; 'length of <math>otext</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.
  
 
== Examples ==
 
== Examples ==
  
<div id="6SpaceContent" class="zcontent" align="left">
+
#=REPLACEARRAY("STRING","R","%%%") = ST%%%ING
 +
#=REPLACEARRAY(["RED", "GREEN","BLUE"],"GREEN","PINK") = RED PINK BLUE
  
{| id="TABLE3" class="SpreadSheet blue"
 
|- class="even"
 
| class="ssh1_f" |'''ColumnA'''
 
| class="  " |'''ColumnB'''
 
| class="  " |'''ColumnC'''
 
 
|- class="odd"
 
| class="ssh1_f" |123456
 
| class="  " |
 
| class="  " |
 
 
|- class="even"
 
| class="ssh1_f" |replace
 
| class="  " |
 
| class="  " |
 
 
|- class="odd"
 
| class="ssh1_f" |ABCDEF
 
| class="  " |
 
| class="  " |
 
 
|- class="even"
 
| class="ssh1_f" |Mango
 
| class="  " |
 
| class="  " |
 
 
|- class="odd"
 
| class="ssh1_f" |
 
| class="  " |
 
| class="  " |
 
|}
 
 
=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==
 
==Related Videos==

Revision as of 04:22, 14 May 2017

REPLACEARRAY(Array,Match,Replacement)

  • where is the original or old array
  • is the matching character in old array
  • is the new character that replaces the matching characters in old array

REPLACEARRAY() replaces the characters from the original array with mentioned characters or string.


Description

REPLACEARRAY(Array,Match,Replacement)

For Example,

REPLACEARRAY("WELCOME","L","***") returns WE***COME

In above example, original text is replaced with new text for the 3rd character.

  • can be array characters or text. Characters or text should be written in double quotes ("").
  • can be a character. If it does not match, original array is displayed as it is.
  • Argument can be a single character or a string.
  • If any arguments are invalid, Calci displays an #ERROR message.

Examples

  1. =REPLACEARRAY("STRING","R","%%%") = ST%%%ING
  2. =REPLACEARRAY(["RED", "GREEN","BLUE"],"GREEN","PINK") = RED PINK BLUE


Related Videos

REPLACE

See Also

References