Previous Topic: LCase - Convert Uppercase Letters to Lowercase LettersNext Topic: Len - Obtain the Length of the String


Left - Return the Leftmost n Characters from the String

Valid on NetWare, Symbian OS, UNIX, Windows and Windows CE

The Left function returns a substring containing the leftmost n characters from the string str.

Function format:

Left(str as String, n as Integer) as String
str

Identifies the string from which the left substring is to be taken.

n

Indicates the number of characters of the left substring.

The function returns a substring containing the leftmost n characters from the string str.

Example: Left function

This example shows how the string operations work.

Dim text As String
Text="Unicenter TNG"

Print("Left(text,3) : " + Left(text,3))  'Uni
Print("Mid(text,4,6) : " + Mid(text,4,6)) 'center
Print("Right(text,3) : " + Right(text,3)) 'TNG
Print("Length    : " + Str(Len(text))) '13