dos_strinsert

插入字符或子串到给定的索引位置.


语法

(dos_strinsert string index chars)

参数

string

字符串.

 

index

以0开始的索引, 指定插入位置. 如果index是0则将子串放置在开头. 如果index大于string的长度, 函数将连接子串到末尾.

 

chars

要插入的子串.

返回

如果成功, 返回修改后的字符串.

nil 失败时.

示例

Command: (setq str "HockeyBest.")

"HockeyBest."

 

Command: (dos_strinsert str 6 " is the ")

"Hockey is the Best."