Difference between revisions of "Manuals/calci/REPLACEB"

From ZCubes Wiki
Jump to navigation Jump to search
(Created page with "<div id="6SpaceContent" class="zcontent" align="left"> '''REPLACEB'''(Old _Text, Start_Num, Num_Char, New_Text) where, '''Old_Text''' - is the text inwhich to repla...")
 
Line 1: Line 1:
<div id="6SpaceContent" class="zcontent" align="left">
+
=REPLACEB(Old_Text, Start_Num, Num_Char, New_Text)=
  
'''REPLACEB'''(Old _Text, Start_Num, Num_Char, New_Text)
+
*where, <math>Old_Text</math> is the original or old text
 +
*<math>Start_Num</math> represents the character position in old text
 +
*<math>Num_Char</math> represents the number of characters to be replaced in old text
 +
*<math>New_Text</math> is the new text with which specified number of characters in old text are replaced
  
where,
+
REPLACEB() replaces a part of old text string with a new text string, based on the number of bytes specified.
  
'''Old_Text''' - is the text inwhich to replace some characters.
+
== Description ==
  
'''Start_Num''' - represents the position of the character in Old_Text, to replace with New_Text.
+
For Example,
 +
REPLACEB("JOHN",2,1,"$") returns ''J$HN''
  
'''Num_Char'''- represents the number of characters in Old_Text,to replace with New_Text.
+
*This function counts and replaces specified number of byte characters with a new text string.
 +
*REPLACEB is intended for languages that use double-byte character set (DBCS).
 +
*If <math>Start_Num</math> &lt; 1, Calci displays #N/A message.
 +
*If <math>Num_Char</math> &lt; 1, Calci displays #N/A message.
  
'''New_Text''' - the text that replace characters in Old_Text.
+
== Examples ==
  
</div>
+
<div id="6SpaceContent" class="zcontent" align="left">
----
 
<div id="1SpaceContent" class="zcontent" align="left">
 
  
REPLACEB replaces part of a text string, based on the number of bytes you specify, with a different text string. REPLACEB is intended for use with languages that use the double-byte character set (DBCS).
+
{| id="TABLE3" class="SpreadSheet blue"
 +
|- class="even"
 +
| class="ssh1_f" |ColumnA
 +
| class="  " |ColumnB
 +
| class="  " |ColumnC
  
</div>
+
|- class="odd"
----
+
| class="ssh1_f" |123456
<div id="7SpaceContent" class="zcontent" align="left">
+
| class=" " |
 +
| class=" " |
  
If Start_Num &lt; 1, REPLACEB returns #ERROR.
+
|- class="even"
 +
| class="ssh1_f" |*****
 +
| class="  " |
 +
| class="  " |
  
If Num_Chars &lt; 1, REPLACEB returns #ERROR.
+
|- class="odd"
 +
| class="ssh1_f" |STAR
 +
| class="  " |
 +
| class="  " |
  
</div>
+
|- class="odd"
----
+
| class="ssh1_f" |
<div id="12SpaceContent" class="zcontent" align="left"><div class="ZEditBox" align="left">
+
| class=" " |
 
+
| class=" " |
REPLACEB
+
|}
 
 
</div></div>
 
----
 
<div id="8SpaceContent" class="zcontent" align="left">
 
 
 
Lets see an example in (Column1, Row2)
 
 
 
<nowiki>=REPLACEB(R1C1, 2, 1, "$")</nowiki>
 
 
 
REPLACEB returns J$HN SMITH.
 
 
 
Lets see an another example in (Column1,Row3)
 
  
<nowiki>=REPLACEB(R1C1, -1, 2, "#")</nowiki>
+
=REPLACEB(A1,1,2,"*") : Replaces first two characters from old text with "*". Returns '''*3456''' as output.
 +
=REPLACEB(A2,2,1,"@") :Replaces first byte (2 characters) from old text with upper case "@". Returns '''@****''' as output.
 +
=REPLACEB(A3,2,1,"aa") : Replaces 2nd character from old text with "aa". Returns '''SaaAR''' as output.
  
REPLACEB returns #ERROR(Start_Num =-1).
+
== See Also ==
  
</div>
+
*[[Manuals/calci/REPLACE | REPLACE]]
----
+
*[[Manuals/calci/SUBSTITUTE | SUBSTITUTE]]
<div id="10SpaceContent" class="zcontent" align="left"><div class="ZEditBox" align="justify">Syntax </div><div class="ZEditBox"><center></center></div></div>
+
*[[Manuals/calci/REPT | REPT]]
----
 
<div id="4SpaceContent" class="zcontent" align="left"><div class="ZEditBox" align="justify">Remarks </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"
+
==References==
|+ Default Calci
 
|- class="even"
 
| class=" " |
 
| Column1
 
| Column2
 
| Column3
 
| Column4
 
|- class="odd"
 
| class=" " | Row1
 
| JOHN SMITH
 
| class=" " |
 
|
 
|
 
|- class="even"
 
| class="  " | Row2
 
| class="sshl_f" | J$HN SMITH
 
|
 
|
 
|
 
|- class="odd"
 
| Row3
 
| class="sshl_f" | #ERROR
 
|
 
|
 
|
 
|- class="even"
 
| Row4
 
| class="        SelectTD1 ChangeBGColor SelectTD1" |
 
<div id="2Space_Handle" class="zhandles" title="Click and Drag to resize CALCI Column/Row/Cell. It is EZ!"></div><div id="2Space_Copy" class="zhandles" title="Click and Drag over to AutoFill other cells."></div><div id="2Space_Drag" class="zhandles" title="Click and Drag to Move/Copy Area.">[[Image:copy-cube.gif]]  </div>
 
|
 
|
 
|
 
|- class="odd"
 
| class=" " | Row5
 
| class="                      " |
 
|
 
|
 
|
 
|- class="even"
 
| Row6
 
|
 
|
 
|
 
|
 
|}
 
 
 
{| id="TABLE3_menu"
 
| align="right" | TABLE3
 
| <span align="left">[[Image:calci1.gif]]</span>
 
|
 
|
 
[[Image:bold.gif]]
 
|
 
[[Image:italic.gif]]
 
|
 
[[Image:normal.gif]]
 
|
 
[[Image:underline.gif]]
 
|
 
[[Image:border.gif]]
 
|
 
[[Image:numbers.gif]]
 
|
 
[[Image:sort.gif]]
 
|
 
[[Image:formatcells.gif]]
 
|
 
[[Image:graphs.gif]]
 
| $
 
|}
 
  
</div>
+
*[http://en.wikipedia.org/wiki/Autocorrection Find and Replace]
----
 

Revision as of 18:29, 28 December 2013

REPLACEB(Old_Text, Start_Num, Num_Char, New_Text)

  • where, is the original or old text
  • represents the character position in old text
  • represents the number of characters to be replaced in old text
  • is the new text with which specified number of characters in old text are replaced

REPLACEB() replaces a part of old text string with a new text string, based on the number of bytes specified.

Description

For Example, REPLACEB("JOHN",2,1,"$") returns J$HN

  • This function counts and replaces specified number of byte characters with a new text string.
  • REPLACEB is intended for languages that use double-byte character set (DBCS).
  • If < 1, Calci displays #N/A message.
  • If < 1, Calci displays #N/A message.

Examples

ColumnA ColumnB ColumnC
123456
*****
STAR
=REPLACEB(A1,1,2,"*") : Replaces first two characters from old text with "*". Returns *3456 as output.
=REPLACEB(A2,2,1,"@") :Replaces first byte (2 characters) from old text with upper case "@". Returns @**** as output.
=REPLACEB(A3,2,1,"aa") : Replaces 2nd character from old text with "aa". Returns SaaAR as output.

See Also

References