Skip to content

Instantly share code, notes, and snippets.

@amalloy
Created October 19, 2011 09:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amalloy/1297800 to your computer and use it in GitHub Desktop.
Save amalloy/1297800 to your computer and use it in GitHub Desktop.
(defn linefeed? [a-char] (= (char 10) a-char))
(defn enter? [a-char] (= (char 13) a-char))
(defn in-range? [x lo hi] (<= lo x hi))
(defn interesting? [a-char] (or (linefeed? a-char)
(enter? a-char)
(in-range? (int a-char) 32 126 )))
(defn remove-characters
[text]
(filter interesting? text))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment