← Back to all sparks
S

stringr

DEVOPS
Velocity0.0

Simple consistent wrappers for string operations in R

stringr keeps trading convenient guesses for predictable errors.

tidyversestringsbreaking-changesregexr-language
Current state
stringr is at 1.6.0, which preserved names across the function set, made str_like() case sensitive to match the SQL operator it is named after, and changed str_replace_all() so a replacement function receives one vector of all values — faster, and breaking for anyone relying on the old call pattern. It also added str_ilike() and the programming-case helpers str_to_camel(), str_to_snake() and str_to_kebab().
Where it's heading
Every substantial release in this window removes an accommodation. 1.5.0 enforced tidyverse recycling rules so only length-1 vectors recycle, turned many warnings into errors, and made str_detect() with an empty string an error rather than a silent TRUE. 1.6.0 continues that: the functions guess less and reject more, and each round trades a convenience for a predictable failure.
Prediction
With str_like(ignore_case) newly deprecated, the next release most likely completes that removal and continues aligning behaviour with SQL string operators rather than adding a new function family.

Recent moves

  1. 9mo ago

    Name preservation, str_ilike() and faster str_replace_all()

    Names are preserved across the function set, str_like() becomes case sensitive with str_ilike() added alongside it, and str_replace_all() hands a replacement function all values at once for a large speedup that breaks some existing uses. Case-conversion helpers for camel, snake and kebab arrive too.

    View source ↗
  2. 2y ago

    Documentation polish and a str_trunc() fix

    Documentation polish and a str_trunc() fix for left and center truncation. A small patch between the two large breaking releases.

    View source ↗
  3. 3y ago

    Recycling rules enforced; silent guesses become errors

    The release that set the pattern: tidyverse recycling rules enforced so only length-1 vectors recycle, str_c() ignoring NULLs, many warnings promoted to errors, and str_detect() with an empty string now an error rather than silently returning TRUE.

    View source ↗
  4. 3y ago

    Hot patch for R CMD check failures

    A hot patch to clear R CMD check failures. Nothing reaches users.

    View source ↗
  5. 7y ago

    str_starts(), str_ends() and negate arguments

    Adds str_starts() and str_ends(), a negate argument on str_subset(), str_detect() and str_which(), and str_to_sentence(). Additive work from before the tightening began.

    View source ↗
  6. 8y ago

    Fixes for named replacements, str_trunc() and str_view()

    Three small fixes covering modifier functions in named replacements, str_trunc() vectorisation and NA handling in str_view(). Routine.

    View source ↗