Difference between revisions of "Manuals/calci/LEFT"
Jump to navigation
Jump to search
(5 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
where, | where, | ||
− | * | + | *'''Text''' is a text string containing characters to extract, |
− | * | + | *'''Number_chars''' represents the number of characters to be extracted. |
LEFT() displays the specified number of characters from a text string. | LEFT() displays the specified number of characters from a text string. | ||
Line 9: | Line 9: | ||
== Description == | == Description == | ||
− | LEFT( | + | LEFT(Text, Number_chars) |
e.g. LEFT("String",2) displays '''St''' as a result. | e.g. LEFT("String",2) displays '''St''' as a result. | ||
− | *LEFT counts 1 byte per | + | *LEFT counts 1 byte per character. LEFT works with the languages that use 'Single Byte Character Set' (SBCS). |
− | * | + | *'''Text''' can be any string containing characters, numbers, symbols, blankspaces etc. |
− | *If argument | + | *If argument '''Text''' is directly entered in the command, it should be enclosed in double quotes (e.g. "Name"). |
− | *Argument | + | *Argument '''Number_chars''' indicates the number of characters to be displayed from a text string. '''Number_chars''' should be >0. |
− | *If | + | *If '''Number_chars''' >'length of text', Calci displays the entire text. |
− | *If | + | *If '''Number_chars''' is omitted, Calci assumes it to be 1. |
== Examples == | == Examples == | ||
Line 50: | Line 50: | ||
=LEFT(A1,8) : Displays first 8 characters in a string from cell A1. Displays '''Wel-Come''' as the output. | =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(A2,5) : Displays first 5 characters in a string from cell A2. Displays '''JOHN ''' as the output. Space Character is also counted. | ||
+ | =LEFT(A2) : Displays first character '''J''' in a string from cell A2 as the output. | ||
=LEFT(A3,4) : Displays first 4 characters in a string from cell A3. Displays '''123*''' as the output. | =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. | =LEFT("Good Morning",20) :Displays the full text string '''Good Morning''' as the output. | ||
+ | |||
+ | == Related Videos == | ||
+ | {{#ev:youtube|C_qfEZPbPSk|280|center|LEFT}} | ||
== See Also == | == See Also == |
Latest revision as of 15:19, 15 April 2015
LEFT(Text, Number_chars)
where,
- Text is a text string containing characters to extract,
- Number_chars represents the number of characters to be extracted.
LEFT() displays the specified number of characters from a text string.
Description
LEFT(Text, Number_chars)
e.g. LEFT("String",2) displays St as a result.
- LEFT counts 1 byte per character. LEFT works with the languages that use 'Single Byte Character Set' (SBCS).
- 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 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 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(A2) : Displays first character J in a string from cell A2 as the output. =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.