Difference between revisions of "Manuals/calci/LEFT"
Jump to navigation
Jump to search
Line 1: | Line 1: | ||
− | + | =LEFT(Text, Number_chars)= | |
− | + | where, | |
+ | *<math>Text</math> is a text string containing characters to extract, | ||
+ | *<math>Number_chars</math> represents the number of characters to be extracted. | ||
− | + | LEFT() displays the specified number of characters from a text string. | |
− | + | == Description == | |
− | + | LEFT(txt) | |
− | ''' | + | e.g. LEFT("String",2) displays '''St''' as a result. |
− | </ | + | *LEFT counts 1 byte per characters. LEFT works with the languages that use 'Single Byte Character Set' (SBCS). |
− | + | *<math>Text</math> can be any string containing characters, numbers, symbols, blankspaces etc. | |
− | < | + | *If argument <math>Text</math> is directly entered in the command, it should be enclosed in double quotes (e.g. "Name"). |
+ | *Argument <math>Number_chars</math> indicates the number of characters to be displayed from a text string. <math>Number_chars</math> should be >0. | ||
+ | *If <math>Number_chars</math> >'length of text', Calci displays the entire text. | ||
+ | *If <math>Number_chars</math> is omitted, Calci assumes it to be 1. | ||
− | + | == Examples == | |
− | + | Consider the following examples as input to LEFT() function. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
<div id="2SpaceContent" class="zcontent" align="left"> | <div id="2SpaceContent" class="zcontent" align="left"> | ||
{| id="TABLE3" class="SpreadSheet blue" | {| id="TABLE3" class="SpreadSheet blue" | ||
|- class="even" | |- class="even" | ||
− | | class=" " | | + | | class="sshl_f" |Wel-Come |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
| class=" " | | | class=" " | | ||
| class=" " | | | class=" " | | ||
+ | |||
|- class="odd" | |- class="odd" | ||
− | + | | class="sshl_f" |JOHN SMITH | |
− | | class="sshl_f" | | ||
− | |||
| class=" " | | | class=" " | | ||
| class=" " | | | class=" " | | ||
+ | |||
|- class="even" | |- class="even" | ||
− | + | | class="sshl_f" |123*123 | |
− | | class="sshl_f" | | ||
− | |||
| class=" " | | | class=" " | | ||
| class=" " | | | class=" " | | ||
+ | |||
|- class="odd" | |- class="odd" | ||
− | | class=" | + | | class="sshl_f" | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
| class=" " | | | class=" " | | ||
| class=" " | | | class=" " | | ||
|} | |} | ||
+ | |||
+ | =LEFT(A1,8) : Displays first 8 characters in a string from cell A1. Displays '''Wel-Come''' as the output. | ||
+ | =LEFT(A2,5) : Displays first 5 characters in a string from cell A2. Displays '''JOHN ''' as the output. Space Character is also counted. | ||
+ | =LEFT(A3,4) : Displays first 4 characters in a string from cell A3. Displays '''123*''' as the output. | ||
+ | =LEFT("Good Morning",20) :Displays the full text string '''Good Morning''' as the output. | ||
+ | |||
+ | == See Also == | ||
+ | |||
+ | *[[Manuals/calci/LEFTB | LEFTB]] | ||
+ | |||
+ | == References == | ||
+ | |||
+ | *[http://en.wikipedia.org/wiki/String_(computer_science) String] |
Revision as of 16:40, 27 January 2014
LEFT(Text, Number_chars)
where,
- is a text string containing characters to extract,
- represents the number of characters to be extracted.
LEFT() displays the specified number of characters from a text string.
Description
LEFT(txt)
e.g. LEFT("String",2) displays St as a result.
- LEFT counts 1 byte per characters. LEFT works with the languages that use 'Single Byte Character Set' (SBCS).
- can be any string containing characters, numbers, symbols, blankspaces etc.
- If argument is directly entered in the command, it should be enclosed in double quotes (e.g. "Name").
- Argument indicates the number of characters to be displayed from a text string. should be >0.
- If >'length of text', Calci displays the entire text.
- If is omitted, Calci assumes it to be 1.
Examples
Consider the following examples as input to LEFT() function.
Wel-Come | ||
JOHN SMITH | ||
123*123 | ||
=LEFT(A1,8) : Displays first 8 characters in a string from cell A1. Displays Wel-Come as the output. =LEFT(A2,5) : Displays first 5 characters in a string from cell A2. Displays JOHN as the output. Space Character is also counted. =LEFT(A3,4) : Displays first 4 characters in a string from cell A3. Displays 123* as the output. =LEFT("Good Morning",20) :Displays the full text string Good Morning as the output.