Skip to content

dos_strtrim

Dale Fugier edited this page Jul 1, 2026 · 1 revision

Trims leading and trailing characters from a string.

Syntax

(dos_strtrim string [chars])

Parameters

string

A string.

chars

A string containing the target characters to be trimmed. If chars is not specified, this function removes leading and trailing newline, space, and tab characters from string.

Returns

The modified string if successful.

nil on error.

Example

Command: (setq str " Hockey is the best ")
" Hockey is the best "

Command: (dos_strtrim str)
"Hockey is the best"

Clone this wiki locally