all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: pwl_b <Pawel.Biernat@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: split-string case insensitive?
Date: Mon, 11 Aug 2008 01:40:52 -0700 (PDT)	[thread overview]
Message-ID: <0b6e6416-36dc-42f9-90d1-39699a1a33ae@e39g2000hsf.googlegroups.com> (raw)
In-Reply-To: 87progyjsp.fsf@hubble.informatimago.com

On 10 Sie, 17:24, p...@informatimago.com (Pascal J. Bourguignon)
wrote:
> pwl_b <Pawel.Bier...@gmail.com> writes:
> > Hi!
>
> > I am trying to split a string in eLisp using split-string, and here is
> > a sample outcome of it:
>
> > (split-string "Abcade" "A" t)
> > => ("bc" "de")
>
> > The question is: Why it does not care about case of "A"? And is there
> > a way to split string in case-sensitive manner?
>
> > The strange thing to me is that split-string does accept regexp as a
> > separator, but it still doesn't care about the cases e.g.:
>
> > (split-string "A1ba2b" "A." t)
> > => ("b" "b")
>
> > I would appreciate any help given, and I am sorry if this question has
> > an obvious answer but I couldn't find any on the Web.
>
> It depends on the setting of the case-fold-search variable:
>
> (let ((case-fold-search t))
>   (split-string "Abcade" "A" t)) --> ("bc" "de")
>
> (let ((case-fold-search nil))
>   (split-string "Abcade" "A" t)) --> ("bcade")
>
> --
> __Pascal Bourguignon__                    http://www.informatimago.com/
>
> In a World without Walls and Fences,
> who needs Windows and Gates?

It does work! Thanks a lot!


      reply	other threads:[~2008-08-11  8:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-10 14:10 split-string case insensitive? pwl_b
2008-08-10 15:24 ` Pascal J. Bourguignon
2008-08-11  8:40   ` pwl_b [this message]

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0b6e6416-36dc-42f9-90d1-39699a1a33ae@e39g2000hsf.googlegroups.com \
    --to=pawel.biernat@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.