From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.help Subject: Re: removing spaces from a string Date: Wed, 19 Apr 2006 13:42:00 +0200 Organization: Organization?!? Message-ID: <851wvtiygn.fsf@lola.goethe.zz> References: <19il38twme189$.1ey704zs7hwp8$.dlg@40tude.net> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1145450457 13819 80.91.229.2 (19 Apr 2006 12:40:57 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 19 Apr 2006 12:40:57 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Apr 19 14:40:52 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FWByv-0008QG-RO for geh-help-gnu-emacs@m.gmane.org; Wed, 19 Apr 2006 14:40:30 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FWByv-0003Gt-D6 for geh-help-gnu-emacs@m.gmane.org; Wed, 19 Apr 2006 08:40:29 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!newsfeed.gamma.ru!Gamma.RU!npeer.de.kpn-eurorings.net!newsfeed.arcor.de!news.arcor.de!not-for-mail Original-Newsgroups: gnu.emacs.help X-Face: 2FEFf>]>q>2iw=B6, xrUubRI>pR&Ml9=ao@P@i)L:\urd*t9M~y1^:+Y]'C0~{mAl`oQuAl \!3KEIp?*w`|bL5qr,H)LFO6Q=qx~iH4DN; i"; /yuIsqbLLCh/!U#X[S~(5eZ41to5f%E@'ELIi$t^ Vc\LWP@J5p^rst0+('>Er0=^1{]M9!p?&:\z]|;&=NP3AhB!B_bi^]Pfkw User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) Cancel-Lock: sha1:9wSz54wbMzGK/13oU8D71deemCM= Original-Lines: 38 Original-NNTP-Posting-Date: 19 Apr 2006 13:42:10 MEST Original-NNTP-Posting-Host: c51d4607.newsread2.arcor-online.net Original-X-Trace: DXC=hbd^gNP]Q; XJ<1FClJbQ`\Q5U85hF6f; TjW\KbG]kaMXAV6U:Z=fE=_8Hig`fXUj6X1_LiI6ENVa]3>5MOK`O=R[GD5P 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:34456 Archived-At: Peter Tury writes: > On Wed, 19 Apr 2006 12:01:21 +0200, LENNART BORGMAN wrote: > >> From: Peter Tury >> Date: Wednesday, April 19, 2006 11:02 am >> Subject: removing spaces from a string >> >>> Hi, >>> >>> how can I most simply remove all spaces from a string? I plan to >>> have a >>> variable what holds the string, so functions what operates on regions, >>> rectangles or any parts of a buffer, etc. are not good (I guess). >>> >>> I would need something like this: (remove-all-space a-sting-var); >>> if e.g. >>> (setq a-string-var "abcd ef dg ") then this should return >>> "abcdefdg" what >>> I will pass forward to another function (namely: process-send-string). >>> >>> Thanks! >>> P >>> >> >> Maybe use replace-regexp-in-string? > > Thanks! I looked exactly for this one. Unfortunately I couldn't find it > (using C-h a ..., and browsing the emacs and elisp manuals... -- now I see > I should have used C-h d ...?) It is also possible to do (concat (delq ?\ (append "This is a string" nil))) Or a number of other approaches. -- David Kastrup, Kriemhildstr. 15, 44793 Bochum