a guest Nov 10th, 2014 146 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- (defn trim-0
- "Trim away all extra 0 in front of a number represented as a string.
- 00123 -> 123, 00000 -> 0"
- (loop [l text]
- (let [x (first l)
- xs (rest l)]
- (= x \0) (recur xs)
- (= x nil) "0"
- :else (clojure.string/join l)))))
RAW Paste Data