Reputation: 43
I'm trying to replace all single quotation marks with double quotation marks in Clojure. i.e. if the string id " 'name' " I want it to become " "name" ". How can I do that?
I've been trying to use the replace function like this:
(clojure.string/replace " 'The color is red' " #"'" """)
but it is not working.
Upvotes: 0
Views: 348
Reputation: 29958
I do this so often I made some convenience functions:
You can find the details here. You may also find this template project useful, esp. the documentation list at the end.
Upvotes: 1
Reputation: 16035
You've forgotten to escape the double quotation mark
(clojure.string/replace " 'The color is red' " #"'" "\"")
Upvotes: 2