Created
November 18, 2014 23:54
-
-
Save dholstius/51c6403bae1921d6a2f6 to your computer and use it in GitHub Desktop.
titlecase.R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
titlecase <- function (x) { | |
# TODO: use Rex package | |
gsub("\\b([a-z])([a-z]+)", "\\U\\1\\L\\2", tolower(x), perl = TRUE) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment