[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] Appending a newline to a string
From: |
Christian Kellermann |
Subject: |
Re: [Chicken-users] Appending a newline to a string |
Date: |
Thu, 21 Oct 2010 17:25:08 +0200 |
User-agent: |
Mutt/1.5.20 (2009-06-14) |
* Joe Python <address@hidden> [101021 17:13]:
> How to append a newline to a string?
> I wish to do that in memory before I start writing to a file.
> The string function seems to stringify the newline control character as
> follows.
>
> ------------< snip >---------------------------
>
> (apply string '(#\a #\b #\newline)) => "ab\n"
>
> ------------< snip >------------------------------
Easy but not portable:
(sprintf "~a~%" "ab") => "ab\n"
or just
(string-append "ab" (string #\newline))
Have fun with scheme!
Christian