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
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
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:
(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.
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
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 -
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
(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.
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