blob: 5d361c75e95ea61846a3c0097b629c883c46bd4e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
<h4 class="subsubsection">Syntax for Strings</h4> <p>The read syntax for a string is a double-quote, an arbitrary number of characters, and another double-quote, <code>"like this"</code>. To include a double-quote in a string, precede it with a backslash; thus, <code>"\""</code> is a string containing just one double-quote character. Likewise, you can include a backslash by preceding it with another backslash, like this: <code>"this \\ is a single embedded
backslash"</code>. </p> <p>The newline character is not special in the read syntax for strings; if you write a new line between the double-quotes, it becomes a character in the string. But an escaped newline—one that is preceded by ‘<samp>\</samp>’—does not become part of the string; i.e., the Lisp reader ignores an escaped newline while reading a string. An escaped space ‘<samp>\ </samp>’ is likewise ignored. </p> <div class="example"> <pre class="example">"It is useful to include newlines
in documentation strings,
but the newline is \
ignored if escaped."
⇒ "It is useful to include newlines
in documentation strings,
but the newline is ignored if escaped."
</pre>
</div><div class="_attribution">
<p class="_attribution-p">
Copyright © 1990-1996, 1998-2022 Free Software Foundation, Inc. <br>Licensed under the GNU GPL license.<br>
<a href="https://www.gnu.org/software/emacs/manual/html_node/elisp/Syntax-for-Strings.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/Syntax-for-Strings.html</a>
</p>
</div>
|