You're viewing version 1.2.0 of println-str. The latest stable version of Clojure Core is 1.3.0.
1.2.0 Arrow_down_16x16

println-str

clojure.core

  • (println-str & xs)
println to a string, returning it

1 Example top

  • ;; Create a newline-terminated string from the items and store it in x.
    user=> (def x (println-str 1 "foo" \b \a \r {:a 2}))
    #'user/x
    
    ;; It's a string.
    user=> (string? x)
    true
    
    ;; Notice that the items are separated by a space.  Also, the newline string is
    ;; platform-specific. See clojure.core/newline.
    user=> x
    "1 foo b a r {:a 2}\r\n"
    
Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/core.clj:3718 top

(defn println-str
  "println to a string, returning it"
  {:tag String
   :added "1.0"}
  [& xs]
    (with-out-str
     (apply println xs)))
Vars in clojure.core/println-str: apply defn println with-out-str
Used in 0 other vars

Comments top

No comments for println-str. Log in to add a comment.