[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
string-strip
From: |
Andreas Roehler |
Subject: |
string-strip |
Date: |
Tue, 20 Jun 2006 12:26:11 +0200 |
User-agent: |
Thunderbird 1.5.0.4 (X11/20060516) |
Looks great. Thanks.
Here with this example included:
(defun string-strip (str)
"Return a copy of STR with leading and trailing white space removed.
\(string-strip \" foo \") => \"foo\"
\(string-strip \" \\nfoo\\n \") => \"foo\"
\(string-strip \" foo\\nbar \") => \"foo\\nbar\"
\(string-strip \" \") => \"\"
\(string-strip \" \\n \") => \"\"
"
(save-match-data
(string-match
"\\`[[:space:]\n]*\\(\\(?:.\\|\n\\)*?\\)[[:space:]\n]*\\'" str)
(match-string 1 str)))
- Re: string-strip, (continued)
- Re: string-strip, Kim F. Storm, 2006/06/20
- Re: string-strip, Nick Roberts, 2006/06/20
- Re: string-strip, Johan Bockgård, 2006/06/20
- Re: string-strip, Lars Hansen, 2006/06/21
- Re: string-strip, Kim F. Storm, 2006/06/22
- Re: string-strip, Andreas Roehler, 2006/06/22
- Re: string-strip, Kim F. Storm, 2006/06/22
- Re: string-strip, Lars Hansen, 2006/06/28
- Re: string-strip, Juri Linkov, 2006/06/28
- Re: string-strip, Richard Stallman, 2006/06/29
string-strip,
Andreas Roehler <=