Retro Rocket OS
BASIC-Powered Operating System
Loading...
Searching...
No Matches
LTRIM$ Function
LTRIM$(string-expression)

Removes all leading spaces from the start of the string expression and returns the result.


Examples

PRINT LTRIM$(" Hello")

Produces "Hello".

PRINT LTRIM$(" Retro Rocket ")

Produces "Retro Rocket " (only leading spaces removed).

REM Trim input before processing
input$ = " command"
PRINT "Command = ["; LTRIM$(input$); "]"

Notes

  • Only space characters (CHR$(32)) are removed; tabs and other whitespace are not affected.
  • If the string has no leading spaces, it is returned unchanged.
  • Use RTRIM$ to remove trailing spaces, or TRIM$ to remove both ends.

See also: RTRIM$ · TRIM$ · LEN