字符串大小写转换
2022-05-21 本文已影响0人
倪桦
string <- 'abcd'
大写
> toupper(string) #大写
[1] "ABCD"
首字母大写
> stringr::str_to_title(string) #首字母大写
[1] "Abcd"
小写
> tolower(string )#小写
[1] "abcd"
string <- 'abcd'
> toupper(string) #大写
[1] "ABCD"
> stringr::str_to_title(string) #首字母大写
[1] "Abcd"
> tolower(string )#小写
[1] "abcd"