Next: Comparison of Characters and Strings, Previous: Creating Strings, Up: Strings and Characters [Contents][Index]
4.4 Modifying StringsYou can alter the contents of a mutable string via operations described in this section. See Mutability.
The most basic way to alter the contents of an existing string is with aset
(see Functions that Operate on Arrays). (aset string idx char)
stores char into string at character index idx. It will automatically convert a pure-ASCII string to a multibyte string (see Text Representations) if needed, but we recommend to always make sure string is multibyte (e.g., by using string-to-multibyte
, see Converting Text Representations), if char is a non-ASCII character, not a raw byte.
To clear out a string that contained a password, use clear-string
:
This makes string a unibyte string and clears its contents to null characters. It may also change string’s length.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4