|
| From: | Emanuel Berg |
| Subject: | Re: bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt |
| Date: | Mon, 22 Jan 2024 22:05:21 +0100 |
| User-agent: | Gnus/5.13 (Gnus v5.13) |
Andreas Schwab wrote:
>> (defun erc-drop-leading-whitespace (str)
>> (if (string-match " \\(.*\\)" str)
>> (match-string 1 str)
>> str) )
>
> (erc-drop-leading-whitespace "foo bar") => "bar"
Ah, forgot the ^ and $, thank you.
(defun erc-drop-leading-whitespace (str)
(if (string-match "^ \\(.*\\)$" str)
(match-string 1 str)
str) )
--
underground experts united
https://dataswamp.org/~incal
| [Prev in Thread] | Current Thread | [Next in Thread] |