RosettaCodeData/Task/Strip-control-codes-and-extended-characters-from-a-string/Clojure/strip-control-codes-and-extended-characters-from-a-string.clj
2015-02-20 00:35:01 -05:00

8 lines
367 B
Clojure

; generate our test string of characters with control and extended characters
(def range-of-chars (apply str (map char (range 256))))
; filter out the control characters:
(apply str (filter #(not (Character/isISOControl %)) range-of-chars))
; filter to return String of characters that are between 32 - 126:
(apply str (filter #(<= 32 (int %) 126) range-of-chars))