LEFT


Returns the leftmost substring of a string

Syntax:
Usage:
result = Left[$]( str, n )

Parameters:
str
The source string.
n
The number of characters to return from the source string.

Return Value:
Returns the leftmost substring from str.

Description:
Returns the leftmost n characters starting from the left (beginning) of str. If str is empty, then the null string ("") is returned. If n <= 0 then the null string ("") is returned. If n > len(str) then the entire source string is returned.

Examples:
Dim text As String = "hello world"
Print Left(text, 5)
will produce the output:

hello

An Unicode example:

dim text as wstring*20
text = "Привет, мир!"
print left(text, 6) 'displays "Привет"
 


Platform Differences:
Dialect Differences:
Differences from QB:
See also:
Back to String Functions
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki



sf.net phatcode