XLISP > XLISP 2.0  -  Contents  -  Reference  -  Previous | Next

string-left-trim


Type:   -   function (subr)
Source:   -   xlstr.c

Syntax

(string-left-trim trim-stuff string)
trim-stuff - a string expression
string - a string expression
returns - a trimed copy of the string

Description

The 'string-left-trim' function takes the 'trim-stuff' characters and removes them from the left end of the 'string'. The 'trim-stuff' characters are an un-ordered set of characters to be removed, so any character that occurs in 'trim-stuff' is removed if it appears in left portion of 'string'. A new string is created and returned as the result of this function.

Examples

(string-left-trim "." "....foo....")     ; returns "foo...."
(string-left-trim "<>" "<<<<bar>>>>")    ; returns "bar>>>>"
(string-left-trim "(.)" "..(12.34)..")   ; returns "12.34).."

Common Lisp: Common Lisp also supports a list of characters as a valid 'trim-stuff' argument. An example:

(string-trim '(#\Tab #\Newline) mystring)

XLISP does not support non-string parameters. Porting from XLISP will be no problem, but modifications will be necessary if porting from Common Lisp code which uses a list of characters.

See the string-left-trim function in the XLISP 2.0 manual.

  Back to Top


XLISP > XLISP 2.0  -  Contents  -  Reference  -  Previous | Next