From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: pwl_b Newsgroups: gmane.emacs.help Subject: Re: split-string case insensitive? Date: Mon, 11 Aug 2008 01:40:52 -0700 (PDT) Organization: http://groups.google.com Message-ID: <0b6e6416-36dc-42f9-90d1-39699a1a33ae@e39g2000hsf.googlegroups.com> References: <9c602d05-0792-434e-b5e7-4df05d285dcc@m36g2000hse.googlegroups.com> <87progyjsp.fsf@hubble.informatimago.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1218448339 371 80.91.229.12 (11 Aug 2008 09:52:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 11 Aug 2008 09:52:19 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Aug 11 11:53:10 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KSU5M-0007hj-U8 for geh-help-gnu-emacs@m.gmane.org; Mon, 11 Aug 2008 11:53:09 +0200 Original-Received: from localhost ([127.0.0.1]:51733 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KSU4Q-0000JY-Vh for geh-help-gnu-emacs@m.gmane.org; Mon, 11 Aug 2008 05:52:11 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!e39g2000hsf.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 38 Original-NNTP-Posting-Host: 217.147.104.41 Original-X-Trace: posting.google.com 1218444052 28438 127.0.0.1 (11 Aug 2008 08:40:52 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Mon, 11 Aug 2008 08:40:52 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: e39g2000hsf.googlegroups.com; posting-host=217.147.104.41; posting-account=kxqIyQoAAABI8nEbl1Lld0iWEqazDoxN User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.16) Gecko/20080702 Firefox/2.0.0.16,gzip(gfe),gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:161095 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:56442 Archived-At: On 10 Sie, 17:24, p...@informatimago.com (Pascal J. Bourguignon) wrote: > pwl_b 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!