(ns useful.string
  (:use [clojure.string :only [join split capitalize]]))

(defn camelize [s & [lower]]
  (let [parts (split (str s) #"-|_")]
    (apply str
           (if lower
             (cons (first parts) (map capitalize (rest parts)))
             (map capitalize parts)))))

(defn dasherize [s]
  (.. (re-matcher #"\B([A-Z])" (str s))
      (replaceAll "-$1")
      toLowerCase))

(defn underscore [s]
  (.. (re-matcher #"\B([A-Z])" (str s))
      (replaceAll "_$1")
      toLowerCase))
(ns useful.string
  (:use [clojure.string :only [join split capitalize]]))

(defn camelize [str]
  (s/replace str
             #"-(\w)"
             (comp s/upper-case second))[s & [lower]])

(defn dasherize [name]
  (s/replace name
             #"(?<![A-Z])[A-Z]+"
             (comp (partial str "-")
                   s/lower-case)))

(defn underscore [s]
  (.. (re-matcher #"\B([A-Z])" (str s))
      (replaceAll "_$1")
      toLowerCase))
Copy my improved versions of dasherize and camelize from cake
Copy my improved versions of dasherize and camelize from cake

amalloy/useful,flatland/useful,jafingerhut/useful