From: Jesper Harder <harder@myrealbox.com>
Subject: Re: looping over characters in a string in elisp?
Date: Thu, 26 Dec 2002 01:32:33 +0100 [thread overview]
Message-ID: <m3wulxoc0u.fsf@defun.localdomain> (raw)
In-Reply-To: roy-722F9F.18535425122002@reader1.panix.com
Roy Smith <roy@panix.com> writes:
> I can't figure out how to loop over each character in a string in
> elisp (I'm using emacs 20.5.1). I know I can use mapchar to map a
> function to each character, but I'm looking for something that lets me
> do (essentially):
>
> (while char in string
> (do stuff))
Here's two different ways:
(require 'cl)
(setq str "Test!")
(dolist (char (append str nil))
(print char))
(dotimes (i (length str))
(print (aref str i)))
next prev parent reply other threads:[~2002-12-26 0:32 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-12-25 23:53 looping over characters in a string in elisp? Roy Smith
2002-12-26 0:32 ` Jesper Harder [this message]
2002-12-26 15:50 ` Kai Großjohann
2002-12-29 0:33 ` Ian Zimmerman
2002-12-29 11:37 ` Kai Großjohann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m3wulxoc0u.fsf@defun.localdomain \
--to=harder@myrealbox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).