Skip to main content

LEFT

Syntax

LEFT( string, characters)

Description

Returns n-characters starting from the left of stringString may be a constant or variable string.

String functions may not be nested.

A$ = LEFT("this is a test",5) + RIGHT(B$,3)      ' valid string operation

A$ = LEFT("this "+b$,5)                                  ' NOT ALLOWED nested operation

Example

text$ = "hello world"

PRINT LEFT(text$, 5) 'displays "hello"

Differences from other BASICs

  • none from Visual BASIC
  • no equivalent in PBASIC

See also