/ lang / left
Left$
Syntax

    sResult = Left$ ( sArg AS String [ , iLength AS Integer ] ) AS String
    sResult = Left ( sArg AS String [ , iLength AS Integer ] ) AS String

Returns the iLength first characters of a the String sArg.

If iLength is not specified, the first character of the string is returned.

If iLength is negative, all the string except the (- iLength ) last characters is returned.

### Examples

    PRINT Left$("Gambas", 4)
    <hr>Gamb

    PRINT Left$("Gambas")
    <hr>G

    PRINT Left$("Gambas", -1)
    <hr>Gamba

### See also

String Functions