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
dhodge opened this Issue Dec 11, 2017 · 5 comments

Comments

Projects
None yet
4 participants
@dhodge
Copy link

dhodge 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

This comment has been minimized.

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

@dhodge

This comment has been minimized.

Copy link
Author

dhodge 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

This comment has been minimized.

Copy link

wmayner commented Nov 1, 2018

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

@jonthegeek

This comment has been minimized.

Copy link
Contributor

jonthegeek commented Jan 19, 2019

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

@dhodge

This comment has been minimized.

Copy link
Author

dhodge commented Jan 23, 2019

Thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment