View Problem

Capitalise the first letter of each word

Transform "man OF stEEL" into "Man Of Steel"
ExpandDiskEdit
scala
def capitalize(s: String) = { s(0).toUpperCase + s.substring(1, s.length).toLowerCase }

"man OF stEEL".split("\\s") foreach {(x) => text.append(capitalize(x)).append(" ")}
ExpandDiskEdit
scala org.apache.commons
val text = WordUtils.capitalizeFully("man OF stEEL")
ExpandDiskEdit
scala org.apache.commons
val text = StringUtils.join("man OF stEEL".split("\\s") map {(x) => StringUtils.capitalize(x.toLowerCase) + " "})
ExpandDiskEdit
scala
// can be solved without external libraries
(("man OF stEEL" toLowerCase) split " " map (_ capitalize)).mkString(" ")
ExpandDiskEdit
scala
// This is just a slightly more compact form of the previous solution (my fav).
// It would be nice if split defaulted to whitespace (precompiled reg ex).
"man OF stEEL".toLowerCase.split(" ").map(_.capitalize) mkString " "
DiskEdit
csharp
System.Threading.Thread.CurrentThread.CurrentCulture.TextInfo.ToTitleCase("man OF stEEL".ToLowerInvariant());

Submit a new solution for scala or csharp
There are 28 other solutions in additional languages (clojure, cpp, erlang, fantom ...)