Skip to content

Instantly share code, notes, and snippets.

@apmaricich
Last active March 21, 2016 14:09
Show Gist options
  • Select an option

  • Save apmaricich/6f569aa5780a77d96180 to your computer and use it in GitHub Desktop.

Select an option

Save apmaricich/6f569aa5780a77d96180 to your computer and use it in GitHub Desktop.
clj: convert a string to an int
(defn str->int
"Converts a string to an integer"
[string]
(Integer. (re-find #"\d+" string)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment