LEFT$ function

Purpose: LEFT$ returns the leftmost substring of a string.


 Syntax:

 SubStr$ = LEFT$(MainStr$, Length%)

 Parameters:

  • MainStr$ String from which left substring is to be copied.
  • Length% Leftmost substring length.

 Return Value:

  • SubStr$, the return value, is a substring from Main$.

Example:


 DIM RetStr$
 
 RetStr$ = LEFT$("abcdefg", 4)
 
 PRINT RetStr$

Result:

abcd

BCX Console Sample Programs using LEFT$ function.

S15.bas, S55.bas, S61.bas, S87.bas, S116.bas