• (capitalize s)
Converts first character of the string to upper-case, all other
characters to lower-case.

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/contrib/str_utils2.clj:288 top

(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)))))
Vars in clojure.contrib.str-utils2/capitalize: < count defn str subs
Used in 0 other vars

Comments top

No comments for capitalize. Log in to add a comment.