The package BBmisc
now contains the function capitalizeStrings
.
library("BBmisc")
capitalizeStrings(c("the taIl", "wags The dOg", "That Looks fuNny!")
, all.words = TRUE, lower.back = TRUE)
[1] "The Tail" "Wags The Dog" "That Looks Funny!"