Guest User

Untitled

a guest
Feb 17th, 2019
261
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. (defn camelcase->underscore [s]
  2. (->> (clojure.string/split s #"(?=[A-Z])")
  3. (map clojure.string/lower-case)
  4. (interpose "_")
  5. (apply str)))
  6.  
  7. (defn underscore->camelcase [s]
  8. (clojure.string/replace s #"_(\w)" #(clojure.string/upper-case (second %))))
Add Comment
Please, Sign In to add comment