Does it help? In Clojure 1.3.0:
(use ['clojure.string :only '(split)]) (defn str-to-ints [string] (map
If the version of Clojure you are using does not have the clojure.string namespace, you can skip the use command and define the function as follows.
(defn str-to-ints [string] (map #(Integer/parseInt %) (.split #" " string)))
You can get rid of regular expressions by using (.split string " ") in the last line.
source share