Left: Difference between revisions

From NSB App Studio
Jump to navigation Jump to search
(Created page with "LEFT(''string'', ''length'') '''Description''' LEFT returns a string containing a specified number of characters from the left end of a string. The required parameter, ''str...")
 
No edit summary
Line 1: Line 1:
LEFT(''string'', ''length'')
Left(''string'', ''length'')


'''Description'''
== Description ==


LEFT returns a string containing a specified number of characters from the left end of a string. The required parameter, ''string'', is any valid string expression. The required parameter, ''length'', is any valid numeric expression, if length is 0, an empty string ("") is returned, if length is greater than the size of string, the entire string is returned.
Left returns a string containing a specified number of characters from the left end of a string. The required parameter, ''string'', is any valid string expression. The required parameter, ''length'', is any valid numeric expression, if length is 0, an empty string ("") is returned, if length is greater than the size of string, the entire string is returned.


'''Example'''
== Example ==


<pre>
<pre>
REM LEFT Example
Rem Left Example
'LEFT returns substring from string left end
'Left returns substring from string left end
DIM Wendy, Eric
Dim Wendy, Eric
Wendy = "Testaburger"
Wendy = "Testaburger"
Eric = "Cartman"
Eric = "Cartman"
PRINT "The LEFT 4 of " & Wendy & ": " _
Print "The Left 4 of " & Wendy & ": " _
   & LEFT(Wendy, 4)
   & Left(Wendy, 4)
PRINT "The LEFT 4 of " & Eric & ": " _
Print "The Left 4 of " & Eric & ": " _
   & LEFT(Eric, 4)
   & Left(Eric, 4)
</pre>
</pre>


'''Output'''
== Output ==


<pre>
<pre>
The LEFT 4 of Testaburger: Test
The Left 4 of Testaburger: Test
The LEFT 4 of Cartman: Cart
The Left 4 of Cartman: Cart
</pre>
</pre>


'''Related Items'''
== Related Items ==


[[len|LEN]], [[mid|MID]], [[right|RIGHT]]
[[len|LEN]], [[mid|MID]], [[right|RIGHT]]
[[Category:Language Reference]]

Revision as of 02:01, 17 August 2012

Left(string, length)

Description

Left returns a string containing a specified number of characters from the left end of a string. The required parameter, string, is any valid string expression. The required parameter, length, is any valid numeric expression, if length is 0, an empty string ("") is returned, if length is greater than the size of string, the entire string is returned.

Example

Rem Left Example
'Left returns substring from string left end
Dim Wendy, Eric
Wendy = "Testaburger"
Eric = "Cartman"
Print "The Left 4 of " & Wendy & ": " _
  & Left(Wendy, 4)
Print "The Left 4 of " & Eric & ": " _
  & Left(Eric, 4)

Output

The Left 4 of Testaburger: Test
The Left 4 of Cartman: Cart

Related Items

LEN, MID, RIGHT