From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Oliver Scholz Newsgroups: gmane.emacs.help Subject: Re: left-trim and right-trim for strings Date: Mon, 23 Sep 2002 13:28:07 +0200 Organization: Olymp Sender: help-gnu-emacs-admin@gnu.org Message-ID: References: NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: main.gmane.org 1032774985 16603 127.0.0.1 (23 Sep 2002 09:56:25 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 23 Sep 2002 09:56:25 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 17tPx2-0004Je-00 for ; Mon, 23 Sep 2002 11:56:24 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 17tPx3-0002n0-00; Mon, 23 Sep 2002 05:56:25 -0400 Original-Path: shelby.stanford.edu!nntp.stanford.edu!newsfeed.stanford.edu!news.tele.dk!small.news.tele.dk!130.133.1.3!fu-berlin.de!uni-berlin.de!dialin-145-254-196-251.arcor-ip.NET!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 18 Original-NNTP-Posting-Host: dialin-145-254-196-251.arcor-ip.net (145.254.196.251) Original-X-Trace: fu-berlin.de 1032774414 7460789 145.254.196.251 (16 [87814]) X-Orig-Path: hermes!nobody X-Operating-System: GNU/Linux, built from scratch: http://www.linuxfromscratch.org/ X-Attribution: os X-Face: "HgH2sgK|bfH$;PiOJI6|qUCf.ve<51_Od(%ynHr?=>znn#~#oS>",F%B8&\vus),2AsPYb -n>PgddtGEn}s7kH?7kH{P_~vu?]OvVN^qD(L)>G^gDCl(U9n{:d>'DkilN!_K"eNzjrtI4Ya6;Td% IZGMbJ{lawG+'J>QXPZD&TwWU@^~A}f^zAb[Ru;CT(UA]c& User-Agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.3.50 (i686-pc-linux-gnu) Cancel-Lock: sha1:K5UlZBxSVgGWZuEYMRiuO7ubXf0= Original-Xref: nntp.stanford.edu gnu.emacs.help:105165 Original-To: help-gnu-emacs@gnu.org Errors-To: help-gnu-emacs-admin@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.help:1720 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:1720 Klaus Berndl writes: > left-trim: Removing any leading whitespace from a string. > right-trim: Removing any trailing whitespace from a string. > > Are there such functions available in elisp or have i to write them > for myself? Probably rather a dirty trick, but you could abuse `split-string': (car (split-string " Dies ist ein Test." "^[\n\t ]*")) (car (split-string "Dies ist ein Test. " "[\n\t ]*$")) -- Oliver -- 2 Vendémiaire an 211 de la Révolution Liberté, Egalité, Fraternité!