4.4 修改字符串

你可以通过本节描述的操作来修改可变字符串的内容。See 可变性

修改已有字符串内容最基本的方式是使用 aset(see 操作数组的函数)。(aset string idx char) 将字符 char 存入字符串 string 的字符索引 idx 处。如果需要,它会自动将纯 ASCII string 转换为多字节字符串(see Text Representations);但如果 char 是非-ASCII 字符(而非原始字节),我们建议你始终确保 string 是多字节类型(例如使用 string-to-multibyte, see Converting Text Representations)。

若要清空存放密码的字符串,可使用 clear-string

Function: clear-string string

该函数将 string 变为单字节字符串,并将其内容清空为空字符。它还可能改变 string 的长度。

emacs

Emacs

org-mode

Orgmode

Donations

打赏

Copyright

© 2025 Jasper Hsu

Creative Commons

Creative Commons

Attribute

Attribute

Noncommercial

Noncommercial

Share Alike

Share Alike