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
Labels
feature a feature request or enhancement tidy-dev-day 🤓 Tidyverse Developer Day rstd.io/tidy-dev-day

Comments

@ghost
Copy link

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 commented Dec 28, 2017

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

cc @gagolews

@hadley hadley added the feature a feature request or enhancement label Dec 28, 2017
@ghost
Copy link
Author

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 commented Nov 1, 2018

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

@jonthegeek
Copy link
Contributor

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

@hadley hadley added the tidy-dev-day 🤓 Tidyverse Developer Day rstd.io/tidy-dev-day label Jan 19, 2019
@ghost
Copy link
Author

ghost commented Jan 23, 2019

Thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement tidy-dev-day 🤓 Tidyverse Developer Day rstd.io/tidy-dev-day
Projects
None yet
Development

No branches or pull requests

3 participants