Left – Remote Processing CAMBASIC User Manual

Page 101

Advertising
background image

Comm ands - 68

LEFT$

String Function

SYNTAX:

n$ = LEF T$(m $, p)

PURPOSE:

To re turn the leftm ost p characters of m$.

REMARK S:

If p is greater than the length of m$, the entire string (m$) will be returned. If p = 0, a null string is
returned.

RELATED:

LEN, MID$, RIGHT$, INSTR

EXAMPLE:

10 A$ = "Hopeless"
20 B$ = LEFT$(A$,4)
30 PRINT B$
RUN
Hope

ERROR:

< Data negative> – for p
< Data > 255> – for p

Advertising