Function: calc-clean-newlines

calc-clean-newlines is an autoloaded and byte-compiled function defined in calc-yank.el.gz.

Signature

(calc-clean-newlines S)

Source Code

;; Defined in /usr/src/emacs/lisp/calc/calc-yank.el.gz
(defun calc-clean-newlines (s)
  (cond

   ;; Omit leading/trailing whitespace
   ((or (string-match "\\`[ \n\r]+\\([^\001]*\\)\\'" s)
	(string-match "\\`\\([^\001]*\\)[ \n\r]+\\'" s))
    (calc-clean-newlines (math-match-substring s 1)))

   ;; Convert newlines to commas
   ((string-match "\\`\\(.*\\)[\n\r]+\\([^\001]*\\)\\'" s)
    (calc-clean-newlines (concat (math-match-substring s 1) ","
				 (math-match-substring s 2))))

   (t s)))