Skip to content

dos_strtrimright

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

Trims trailing characters from a string.

Syntax

(dos_strtrimright string [chars])

Parameters

string

A string.

chars

A string containing the target characters to be trimmed. All trailing occurrences of characters in charswill be trimmed from string. If charsis not specified, this function removes 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_strtrimright str "!")
"Hockey is the best"

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

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

Clone this wiki locally