Comma separated String values from a Vector
clojure, string, vector
Solution
Use `map` to surround each string with quotes, and notice how we represent a single quote using `\"`, a character literal:
(clojure.string/join "," (map #(str \" % \") my-strings))
=> "one","two","three"
Be warned, though: a string is the text contained inside the `""` characters, but the quotes themselves are not part of the string. so the `"one,two,three"` output is not wrong per se, unless you really really need those extra quotes surrounding the text.
Problem
I'm defining a vector containing string values. The requirement is to retrieve the String values separated by comma from the input vector. For example: ``` (def my-strings ["one" "two" "three"]) ``` My expected output should be: ``` "one", "two", "three" ``` I tried `interpose` and `join` as shown below: ``` (apply str (interpose "," my-strings)) (clojure.string/join "," my-strings) ``` Both returning `"one,two,three"` but I need each string to be surrounded by double quotes `""` like in my example above.