Capitalize the first character of a string without altering case of any other character.

str_to_firstup(string)

Arguments

string

String to modify

Examples

str_to_firstup("age at death")
#> [1] "Age at death"
str_to_firstup("baseline BMI")
#> [1] "Baseline BMI"
c("age at death", "baseline BMI") %>% str_to_firstup()
#> [1] "Age at death" "Baseline BMI"