|
From: | Jambunathan K |
Subject: | Re: Bug in some calls to split-string. |
Date: | Sat, 20 Jul 2013 13:26:12 +0530 |
User-agent: | Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
"Stephen J. Turnbull" <address@hidden> writes: > Trimming leading and trailing whitespace is a generally useful > function. Org-mode's usage of `org-trim' gives this proposal 100+ upvotes. (defun org-trim (s) "Remove whitespace at beginning and end of string." (if (string-match "\\`[ \t\n\r]+" s) (setq s (replace-match "" t t s))) (if (string-match "[ \t\n\r]+\\'" s) (setq s (replace-match "" t t s))) s)
[Prev in Thread] | Current Thread | [Next in Thread] |