Skip to content

dos_strinsert

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

Inserts a single character or a substring at the given index within the string.

Syntax

(dos_strinsert string index chars)

Parameters

string

A string.

index

The zero-based index of the character before which the insertion will take place. If index is zero, the insertion will occur before the entire string. If index is higher than the length of string, the function will concatenate chars to the present string

chars

The characters to inserted.

Returns

The modified string if successful.

nil on error.

Example

Command: (setq str "HockeyBest.")
"HockeyBest."

Command: (dos_strinsert str 6 " is the ")
"Hockey is the Best."

Clone this wiki locally