Converts first character of the string to upper-case, all other
characters to lower-case.
(defn ^String capitalize
"Converts first character of the string to upper-case, all other
characters to lower-case."
[^String s]
(if (< (count s) 2)
(.toUpperCase s)
(str (.toUpperCase ^String (subs s 0 1))
(.toLowerCase ^String (subs s 1)))))
Comments top
No comments for capitalize. Log in to add a comment.