How can I pretty print a PersistentHashMap in Clojure to a string? I am looking for something like:
(str (pprint {... hash map here...})
which
This should help:
(clojure.pprint/write {:a 1 :b 2} :stream nil)
according to clojure.pprint/write documentation
Returns the string result if :stream is nil or nil otherwise.