Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

str_to_sentence #202

Closed
ghost opened this issue Dec 11, 2017 · 5 comments
Closed

str_to_sentence #202

ghost opened this issue Dec 11, 2017 · 5 comments

Comments

@ghost
Copy link

@ghost ghost commented Dec 11, 2017

Hi, could we please have a function that converts a string to sentence case. Some code below with my attempt at this..

str_to_sentence <- function(x) {
paste0(str_to_upper(str_sub(x, 1, 1)), str_to_lower(str_sub(x, 2)))
}

@hadley
Copy link
Member

@hadley hadley commented Dec 28, 2017

stringr relies on stringi for these functions, so you'd need to get it into stringi first.

cc @gagolews

@ghost
Copy link
Author

@ghost ghost commented Jun 19, 2018

Just found this in stringi @hadley
library(stringi)
stri_trans_totitle("a Test", opts_brkiter = stri_opts_brkiter(type = "sentence"))

@wmayner
Copy link

@wmayner wmayner commented Nov 1, 2018

I'd really like to have the functionality as well!

@jonthegeek
Copy link
Contributor

@jonthegeek jonthegeek commented Jan 19, 2019

@batpigandme I'm working on this for Tidyverse Developer Day.

@ghost
Copy link
Author

@ghost ghost commented Jan 23, 2019

Thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants