Does this help? user> (use 'clojure.string) nil user> (join "," (range 10)) "0,1,2,3,4,5,6,7,8,9"
-Avram On Oct 28, 4:22 am, andrei <andrei.zhabin...@gmail.com> wrote: > I was seeking `interpose` function, thanks. But it still doesn't work > for strings - they are not wrapped by "\"\. E.g. > > (apply str (interpose ", " (list 1 2 3 4 5))) ==> "1, 2, 3, 4, 5" > > and > > (apply str (interpose ", " (list "1" "2" "3" "4" "5"))) ==> "1, 2, 3, > 4, 5" > > The problem is that applying `str` to strings just concatenates them > and doesn't include inverted commas. It's the same issue that applies > to `print` and `pr` functions - first just prints, and the second > prints in the form that can be read by reader. Is there an equivalent > of `pr` that returns string "as is"? > > Of course, I can make such trick: > > (defn pr-to-str [o] > (let [sw (StringWriter.)] > (binding [*out* sw] > (pr o)) > (str sw))) > > But aren't there such built-in function? -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en