Difference between revisions of "Manuals/calci/LEFTB"

From ZCubes Wiki
Jump to navigation Jump to search
(Created page with "<div id="6SpaceContent" class="zcontent" align="left"> '''LEFTB'''(Text, Number_chars) where, '''Text''' - is the text string to extract. '''Number_chars''' - re...")
 
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<div id="6SpaceContent" class="zcontent" align="left">
+
<div style="font-size:30px">'''LEFTB (Text,Number_chars) '''</div><br/>
  
'''LEFTB'''(Text, Number_chars)
+
where,
 +
*'''Text''' is a text string containing characters to extract,
 +
*'''Number_chars''' represents the number of characters to be extracted.
 +
**LEFTB(), returns the leftmost characters from a text value.LEFTB is intended for use with languages that use the double-byte character set (DBCS).
  
where,
+
== Description ==
  
'''Text''' - is the text string to extract.
+
LEFTB (Text,Number_chars)
  
'''Number_chars''' - represents the number of charcaters you want LEFT to extract.
+
e.g. LEFTB("String",2) displays '''St''' as a result.
  
</div>
+
*LEFTB counts 2 bytes per character when system is set to language supporting DBCS, else counts 1 byte per character.
----
+
*LEFTB works with the languages that use 'Double Byte Character Set' (DBCS).
<div id="1SpaceContent" class="zcontent" align="left">
+
*'''Text''' can be any string containing characters, numbers, symbols, blankspaces etc.
 +
*If argument '''Text''' is directly entered in the command, it should be enclosed in double quotes (e.g. "Name").
 +
*Argument '''Number_chars''' indicates the number of byte characters to be displayed from a text string. '''Number_chars''' should be &gt;0.
 +
*If '''Number_chars''' &gt;'length of text', Calci displays the entire text.
 +
*If '''Number_chars''' is omitted, Calci assumes it to be 1.
  
LEFTB returns the first character or characters in a text string, based on the number of bytes you specify. LEFTB is intended for use with languages that use the double-byte character set (DBCS).
+
== Examples ==
  
</div>
+
Consider the following examples as input to LEFTB() function.
----
 
<div id="7SpaceContent" class="zcontent" align="left">
 
  
If Number_chars &lt;= 0,LEFTB returns #ERROR.
+
<div id="2SpaceContent" class="zcontent" align="left">
  
If Number_chars &gt; length of text, it returns all of text.
+
{| id="TABLE3" class="SpreadSheet blue"
 +
|- class="even"
 +
| class="sshl_f" |<#!#>
 +
| class=" " |
 +
| class=" " |
  
If Number_chars is omitted, it is considered as 1.
+
|- class="odd"
 +
| class="sshl_f" |JOHN SMITH
 +
| class=" " |
 +
| class=" " |
  
</div>
+
|- class="even"
----
+
| class="sshl_f" |123*123
<div id="12SpaceContent" class="zcontent" align="left"><div class="ZEditBox" align="left">
+
| class=" " |
 +
| class=" " |
  
LEFTB
+
|- class="odd"
 +
| class="sshl_f" |
 +
| class=" " |
 +
| class=" " |
 +
|}
  
</div></div>
+
=LEFTB(A1,4) : Displays first 4 characters in a string from cell A1. Displays '''<#!#''' as the output.
----
+
=LEFTB(A2,5) : Displays first 5 characters in a string from cell A2. Displays '''JOHN ''' as the output. Space Character is also counted.
<div id="8SpaceContent" class="zcontent" align="left">
+
=LEFTB(A2) : Displays first character '''J''' in a string from cell A2 as the output.
 +
=LEFTB(A3,4) : Displays first 4 characters in a string from cell A3. Displays '''123*''' as the output.
 +
=LEFTB("Good Morning",20) :Displays the full text string '''Good Morning''' as the output.
  
Lets see an example in (Column1, Row2)
+
<font color ="Red">Need to give examples with characters/language supporting DBCS </font>
  
<nowiki>=LEFTB(R1C1,2)</nowiki>
+
==Related Videos==
  
LEFTB returns JO.
+
{{#ev:youtube|C_qfEZPbPSk|280|center|LEFT function}}
  
Lets see an another example in (Column1,Row3)
+
== See Also ==
  
<nowiki>=LEFTB(R1C1)</nowiki>
+
*[[Manuals/calci/LEFT | LEFT]]
  
LEFTB returns J(if omitted,considered as 1).
+
== References ==
  
Consider an example in (Column1, Row4)
+
*[http://en.wikipedia.org/wiki/String_(computer_science) String]
  
<nowiki>=LEFTB(R1C1,20)</nowiki>
 
  
LEFTB returns JOHN SMITH(Number_chars&gt; length of text).
 
  
</div>
+
*[[Z_API_Functions | List of Main Z Functions]]
----
 
<div id="10SpaceContent" class="zcontent" align="left"><div class="ZEditBox" align="justify">Syntax </div><div class="ZEditBox"><center></center></div></div>
 
----
 
<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"
 
|+ Default Calci
 
|- class="even"
 
| class=" " |
 
| Column1
 
| Column2
 
| Column3
 
| Column4
 
|- class="odd"
 
| class=" " | Row1
 
| class=" " | JOHN SMITH
 
|
 
|
 
|
 
|- class="even"
 
| class="  " | Row2
 
| class="sshl_f" | JO
 
|
 
|
 
|
 
|- class="odd"
 
| Row3
 
| class="sshl_f" | J
 
|
 
|
 
|
 
|- class="even"
 
| Row4
 
| class="sshl_f" | JOHN SMITH
 
|
 
|
 
|
 
|- class="odd"
 
| class=" " | Row5
 
| class="                  " |
 
|
 
|
 
|
 
|- class="even"
 
| Row6
 
|
 
| class="  SelectTD1  SelectTD1 ChangeBGColor" |
 
<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>
 
|
 
|
 
|}
 
 
 
{| 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>
+
*[[ Z3 |  Z3 home ]]
----
 

Latest revision as of 15:59, 13 August 2018

LEFTB (Text,Number_chars)


where,

  • Text is a text string containing characters to extract,
  • Number_chars represents the number of characters to be extracted.
    • LEFTB(), returns the leftmost characters from a text value.LEFTB is intended for use with languages that use the double-byte character set (DBCS).

Description

LEFTB (Text,Number_chars)

e.g. LEFTB("String",2) displays St as a result.

  • LEFTB counts 2 bytes per character when system is set to language supporting DBCS, else counts 1 byte per character.
  • LEFTB works with the languages that use 'Double Byte Character Set' (DBCS).
  • Text can be any string containing characters, numbers, symbols, blankspaces etc.
  • If argument Text is directly entered in the command, it should be enclosed in double quotes (e.g. "Name").
  • Argument Number_chars indicates the number of byte characters to be displayed from a text string. Number_chars should be >0.
  • If Number_chars >'length of text', Calci displays the entire text.
  • If Number_chars is omitted, Calci assumes it to be 1.

Examples

Consider the following examples as input to LEFTB() function.

<#!#>
JOHN SMITH
123*123
=LEFTB(A1,4) : Displays first 4 characters in a string from cell A1. Displays <#!# as the output. 
=LEFTB(A2,5) : Displays first 5 characters in a string from cell A2. Displays JOHN  as the output. Space Character is also counted.
=LEFTB(A2) : Displays first character J in a string from cell A2 as the output.
=LEFTB(A3,4) : Displays first 4 characters in a string from cell A3. Displays 123* as the output.
=LEFTB("Good Morning",20) :Displays the full text string Good Morning as the output.

Need to give examples with characters/language supporting DBCS

Related Videos

LEFT function

See Also

References