stringr icon indicating copy to clipboard operation
stringr copied to clipboard

A fresh approach to string manipulation in R

Results 53 stringr issues
Sort by recently updated
recently updated
newest added

See the following example: ``` r stringr::str_starts("A1", "T") #> [1] FALSE stringr::str_starts("A1", "\\d") #> [1] FALSE stringr::str_starts("A1", "T|\\d") #> [1] TRUE ``` Created on 2022-07-31 by the [reprex package](https://reprex.tidyverse.org) (v2.0.1)

Hi, I am using R 4.1.3 and the stringr-package 1.4.0 and get some unexpected results from this code: ``` stringr::str_replace(string = "5", pattern = "([0-9]+)", replacement = stringr::str_pad(string = "\\1",...

Would it be worthwhile to have an argument in `str_wrap` that lets you choose other separators than `\n`? I usually use `str_wrap() %>% str_replace_all("\n", "")` when working with [{ggtext}](https://wilkelab.org/ggtext/), which...

This is a weird string, but regardless `str_wrap()` is failing to split part of it at the specified width: ``` r library(tidyverse) str_wrap("2-Propenoic acid, 1,1'-[2-[[(1-oxo-2-propen-1-yl)oxy]methyl]-2-[[[[[[1,3,3-trimethyl-5-[[[3-[(1-oxo-2-propen-1-yl)oxy]-2,2-bis[[(1-oxo-2-propen-1-yl)oxy]methyl]propoxy]carbonyl]amino]cyclohexyl]methyl]amino]carbonyl]oxy]methyl]-1,3-propanediyl] ester", width = 50) %>%...

The vignette that shows `{stringr}` functions aligned with their base R equivalents is extremely useful. I check it often. It appears to have been removed. Please consider reinstating it! https://stringr.tidyverse.org/articles/from-base.html

Not sure what to do, but currently ``` r stringr::str_flatten(letters[1:2], ", ", ", and ") #> [1] "a, and b" ``` Created on 2022-06-27 by the [reprex package](https://reprex.tidyverse.org) (v2.0.1)

``` r stringr::str_detect("apple", rex::rex(maybe("a"))) #> Error in `type()`: #> ! `pattern` must be a string ``` Created on 2022-02-23 by the [reprex package](https://reprex.tidyverse.org) (v2.0.1) This is because the change to...