Skip to content

Instantly share code, notes, and snippets.

@bendisposto
Created March 25, 2014 07:08
Show Gist options
  • Save bendisposto/9756517 to your computer and use it in GitHub Desktop.
Save bendisposto/9756517 to your computer and use it in GitHub Desktop.
Removes superflous whitespaces from input. Can be useful to make Instaparse grammars easier (no need to deal with whitespaces everywhere). However, it kills the formatting of the input
(defn normalize-input [s] (clojure.string/join " " (remove empty? (clojure.string/split s #"\s"))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment