Function: clear-string

clear-string is a function defined in fns.c.

Signature

(clear-string STRING)

Documentation

Clear the contents of STRING.

This makes STRING unibyte and may change its length.

View in manual

Source Code

// Defined in /usr/src/emacs/src/fns.c
{
  CHECK_STRING (string);
  ptrdiff_t len = SBYTES (string);
  if (len != 0 || STRING_MULTIBYTE (string))
    {
      CHECK_IMPURE (string, XSTRING (string));
      memset (SDATA (string), 0, len);
      STRING_SET_CHARS (string, len);
      STRING_SET_UNIBYTE (string);
    }
  return Qnil;
}