emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: string-strip


From: Richard Stallman
Subject: Re: string-strip
Date: Mon, 19 Jun 2006 03:42:16 -0400

    What about to introduce a simplified version of `comment-string-strip' 
    into subr.el - if it's not already somewhere?

    (defun my-string-strip (str)
      "Strip STR of any leading (if BEFOREP) and/or trailing (if AFTERP) space."
      (string-match "\\`\\s-*\\(.*?\\)\\s-*\n?\\'" str)
      (match-string 1 str))

    (string-strip "asdf ")"asdf"
    (string-strip " asdf")"asdf"
    (string-strip " asdf ")"asdf"

It is a useful function and a simple one, and it won't delay the
release much.  If you write the manual and NEWS changes for it first,
I will say yes.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]