with-out-str

macrosince v0.0-1535 clojure.core/with-out-strEdit
(with-out-str & body)

Source docstring:
Evaluates exprs in a context in which *print-fn* is bound to .append
on a fresh StringBuffer.  Returns the string created by any nested
printing calls.
Source code @ clojurescript:src/main/clojure/cljs/core.cljc
(core/defmacro with-out-str
  [& body]
  `(let [sb# (goog.string/StringBuffer.)]
     (binding [cljs.core/*print-newline* true
               cljs.core/*print-fn* (fn [x#] (.append sb# x#))]
       ~@body)
     (cljs.core/str sb#)))