From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Klaus Berndl Newsgroups: gmane.emacs.help Subject: Re: left-trim and right-trim for strings Date: 23 Sep 2002 12:02:53 +0200 Organization: sd&m AG, Muenchen, Germany 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 1032777023 21659 127.0.0.1 (23 Sep 2002 10:30:23 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 23 Sep 2002 10:30:23 +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 17tQTt-0005dC-00 for ; Mon, 23 Sep 2002 12:30:21 +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 17tQTa-0000f1-00; Mon, 23 Sep 2002 06:30:02 -0400 Original-Path: shelby.stanford.edu!nntp.stanford.edu!newsfeed.stanford.edu!logbridge.uoregon.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!opentransit.net!newsfeed.online.be!bnewspeer00.bru.ops.eu.uu.net!emea.uu.net!news.sdm.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 31 Original-NNTP-Posting-Host: hickerstall.muc.sdm.de Original-X-Trace: solti3.muc.sdm.de 1032775373 23554 193.102.183.204 (23 Sep 2002 10:02:53 GMT) Original-X-Complaints-To: usenet@news.sdm.de Original-NNTP-Posting-Date: 23 Sep 2002 10:02:53 GMT User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 Original-Xref: nntp.stanford.edu gnu.emacs.help:105166 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:1721 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:1721 On Mon, 23 Sep 2002, Oliver Scholz wrote: > 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 ]*$")) Dirty but also charming :-) I think i will use it. Thanks, Klaus -- Klaus Berndl mailto: klaus.berndl@sdm.de sd&m AG http://www.sdm.de software design & management Thomas-Dehler-Str. 27, 81737 München, Germany Tel +49 89 63812-392, Fax -220