Skip to content

feature for str_replace_all: vectorization of patterns and replacements #582

@mgacc0

Description

@mgacc0

Would you consider to nativelly implement a capability of vectorization of patterns and replacements in str_replace_all by default?
Something equivalent to

str_replace_all_vec <- function(string, pattern, replacement) {
  tmp_string <- string
  for (i in seq_along(pattern)) {
    tmp_string <- str_replace_all(tmp_string, pattern[i], replacement[i])
  }
  tmp_string
}

to apply the replacements sequentially?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions