Re: Comma separated String values from vector

2013-07-16 Thread sunilmuvas
Thanks everyone for contributing. => (clojure.string/join "," (map #(str \" % \") my-strings)) works perfectly for my case and that will do for now. /Sunil. On Tuesday, July 16, 2013 3:52:03 PM UTC+1, Luc wrote: > > I assume here that the strings are already escaped. Which might not be > true

Re: Comma separated String values from vector

2013-07-16 Thread Softaddicts
I assume here that the strings are already escaped. Which might not be true at all. pr-sr is safer in this regard but 6 times slower. Luc P. > (apply str (interpose "," (map #(str "\"" % "\"") [...]))) > > Not the most efficient way but short. > > Luc P. > > > > Hi All, > > > > I'm new to C

Re: Comma separated String values from vector

2013-07-16 Thread Softaddicts
Pr-str is very slow compared to string concats Luc P. > Jay beat me to it. :) > > I'll add the documentation for pr-str: > http://clojuredocs.org/clojure_core/clojure.core/pr-str > > Jonathan > > > On Tue, Jul 16, 2013 at 4:39 PM, Jay Fields wrote: > > > this seems to do what you want:

Re: Comma separated String values from vector

2013-07-16 Thread Softaddicts
(apply str (interpose "," (map #(str "\"" % "\"") [...]))) Not the most efficient way but short. Luc P. > Hi All, > > I'm new to Clojure - > > I'm defining a vector containing string values. The requirement for me is > to retrieve the String values separated by comma from the input vector.

Re: Comma separated String values from vector

2013-07-16 Thread Jonathan Fischer Friberg
Jay beat me to it. :) I'll add the documentation for pr-str: http://clojuredocs.org/clojure_core/clojure.core/pr-str Jonathan On Tue, Jul 16, 2013 at 4:39 PM, Jay Fields wrote: > this seems to do what you want: (clojure.string/join ", " (map pr-str > my-strings)) > > > On Tue, Jul 16, 2013 at

Re: Comma separated String values from vector

2013-07-16 Thread Jay Fields
this seems to do what you want: (clojure.string/join ", " (map pr-str my-strings)) On Tue, Jul 16, 2013 at 10:17 AM, Cedric Greevey wrote: > (apply str "\"" (interpose "\", \"" my-strings) "\"") might work... > > > On Tue, Jul 16, 2013 at 9:53 AM, wrote: > >> Hi All, >> >> I'm new to Clojure -

Re: Comma separated String values from vector

2013-07-16 Thread Maximilian Karasz
hi, i might be wrong but it seems you're looking for something like https://github.com/clojure/data.csv cheers, -Max On Jul 16, 2013, at 3:53 PM, sunilmu...@gmail.com wrote: > Hi All, > > I'm new to Clojure - > > I'm defining a vector containing string values. The requirement for me is to

Re: Comma separated String values from vector

2013-07-16 Thread Cedric Greevey
(apply str "\"" (interpose "\", \"" my-strings) "\"") might work... On Tue, Jul 16, 2013 at 9:53 AM, wrote: > Hi All, > > I'm new to Clojure - > > I'm defining a vector containing string values. The requirement for me is > to retrieve the String values separated by comma from the input vector.

Comma separated String values from vector

2013-07-16 Thread sunilmuvas
Hi All, I'm new to Clojure - I'm defining a vector containing string values. The requirement for me is to retrieve the String values separated by comma from the input vector. Example: => (def my-strings ["one" "two" "three"]) ;; My expected output should be ;; *"one", "two", "three"* I tr