capitalize

added
1.2

ns
clojure.string

type
function

(capitalize s)

Converts first character of the string to upper-case, all other
characters to lower-case.

                user=> (require 'clojure.string)
nil

user=> (clojure.string/capitalize "MiXeD cAsE")
"Mixed case"

user=> (clojure.string/capitalize "mIxEd CaSe")
"Mixed case"

            
                (defn capitalize-words 
  "Capitalize every word in a string"
  [s]
  (->> (string/split (str s) #"\\b") 
       (map string/capitalize)
       string/join))

(capitalize-words "a bunch of words/text")
;;=> "A Bunch Of Words/Text"