I want to replace space characters with plus signs in the search query I send to google.
(defn search-google [search-term]
(clojure.string/replace search-term #" " "+")
(browse-url
(str "http://google.ca/search?q=" search-term)))
However my function fails as my search-term retains spaces.
(search-google "clojure user input")
URISyntaxException Illegal character in query at index 32:
http://google.ca/search?q=clojure user input java.net.URI$Parser.fail (:-1)
I am new at clojure and suspect I am missing something obvious.