str_remove_sandwich: Delete a string of characters sandwiched between specific...

View source: R/str_remove_sandwich.R

str_remove_sandwichR Documentation

Delete a string of characters sandwiched between specific characters

Description

Delete a string of characters sandwiched between specific characters.

Usage

str_remove_sandwich(string, start_pattern, end_pattern, perl = FALSE)

Arguments

string

Input vector. Either a character vector, or something coercible to one.

start_pattern

Specifies the first character of the string to be deleted. It must be different from the last character, end_pattern.

end_pattern

Specifies the last character of the string to be deleted. It must be different from the first character, start_pattern.

perl

logical. Should Perl-compatible regexps be used?

Details

The specified string must be a single character or three characters including the escape, and the first and last characters of the string must be different.


indenkun/infun documentation built on April 17, 2025, 2:52 p.m.