help-gnu-emacs
[Top][All Lists]
Advanced

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

[SOLVED] Re: (rx regexp to remove space and new lines


From: Jean Louis
Subject: [SOLVED] Re: (rx regexp to remove space and new lines
Date: Mon, 12 Sep 2022 13:43:11 +0300
User-agent: Mutt/+ () (2022-06-11)

If there is better way let me know.

(defun rcd-string-clean-whitespace (s)
  "Return trimmed string S without new lines and whitespaces."
  (replace-regexp-in-string 
   (rx (one-or-more (or "\n" (any whitespace))))
   " "
   (string-trim s)))


-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/



reply via email to

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