string_clean: Remove non-letter characters, underscore and repeated...

View source: R/string.R

string_cleanR Documentation

Remove non-letter characters, underscore and repeated whitespace inside a string

Description

Wrapper around string_strip() that also removes underscore and repeated whitespace inside a string.

Usage

string_clean(
  string,
  rm_period = FALSE,
  keep = NULL,
  side = c("both", "left", "right")
)

Arguments

string

A character vector.

rm_period

Should ending periods be removed?

keep

A single character vector of character(s) to keep. Only retains characters that directly follow the first and last letter.

side

Side of the character string to trim. One of c("both", "right", "left").

Value

A character vector.

Examples

string_clean("1. Le Loup et   l'Agneau. ")

arnaudgallou/toolkit documentation built on Nov. 25, 2022, 5:42 p.m.