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 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 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 tried interpose and join as below 
> > > 
> > > => (apply str (interpose "," my-strings)) 
> > > 
> > > => (clojure.string/join "," my-strings) 
> > > 
> > > both returning as "one,two,three" but I need each string surrounded by 
> > > double quotes "" like in my example example. 
> > > 
> > > /Sunil. 
> > > 
> > > 
> > > 
> > >   
> > > 
> > > -- 
> > > -- 
> > > You received this message because you are subscribed to the Google 
> > > Groups "Clojure" group. 
> > > To post to this group, send email to clo...@googlegroups.com<javascript:> 
> > > Note that posts from new members are moderated - please be patient 
> with your first post. 
> > > To unsubscribe from this group, send email to 
> > > clojure+u...@googlegroups.com <javascript:> 
> > > For more options, visit this group at 
> > > http://groups.google.com/group/clojure?hl=en 
> > > --- 
> > > You received this message because you are subscribed to the Google 
> Groups "Clojure" group. 
> > > To unsubscribe from this group and stop receiving emails from it, send 
> an email to clojure+u...@googlegroups.com <javascript:>. 
> > > For more options, visit https://groups.google.com/groups/opt_out. 
> > > 
> > > 
> > > 
> > -- 
> > Softaddicts<lprefo...@softaddicts.ca <javascript:>> sent by ibisMail 
> from my ipad! 
> > 
> > -- 
> > -- 
> > You received this message because you are subscribed to the Google 
> > Groups "Clojure" group. 
> > To post to this group, send email to clo...@googlegroups.com<javascript:> 
> > Note that posts from new members are moderated - please be patient with 
> your first post. 
> > To unsubscribe from this group, send email to 
> > clojure+u...@googlegroups.com <javascript:> 
> > For more options, visit this group at 
> > http://groups.google.com/group/clojure?hl=en 
> > --- 
> > You received this message because you are subscribed to the Google 
> Groups "Clojure" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an email to clojure+u...@googlegroups.com <javascript:>. 
> > For more options, visit https://groups.google.com/groups/opt_out. 
> > 
> > 
> > 
> -- 
> Softaddicts<lprefo...@softaddicts.ca <javascript:>> sent by ibisMail from 
> my ipad! 
>

-- 
-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to