Skip to content

Feature Request: str_squish removes zero-width space #615

Description

@ktomari

I don't fully understand the ins-and-outs of Unicode, but I ran into some English text that has a zero-width space and I expected str_squish would remove it. It did not.

Example:

paste0("End of line has a zero-width space", 
         intToUtf8(x = 0x200B)) |>
  stringr::str_squish() |>
  stringr::str_detect("\u200B")

## [1] TRUE

Perhaps this should remove them by default, or have a parameter that optionally removes it (and other weird space-like characters).

Thank you for all your hard work!!

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