Purpose
Returns part or all of a string, beginning at the left end of the string. You can call this function from the MapBasic window in MapInfo Pro.
Syntax
Left$( string_expr, num_expr )
string_expr is a string expression.
num_expr is a numeric expression, zero or larger.
Return Value
String
Description
The Left$() function returns a string which consists of the leftmost num_expr characters of the string expression string_expr.
The num_expr parameter should be an integer value, zero or larger. If num_expr has a fractional value, MapBasic rounds to the nearest integer. If num_expr is zero, Left$() returns a null string. If the num_expr parameter is larger than the number of characters in the string_expr string, Left$() returns a copy of the entire string_expr string.
Example
Dim whole, partial As String
whole = "Afghanistan"
partial = Left$(whole, 6)
' at this point, partial contains the string: "Afghan"
See Also:
Mid$() function, Right$() function