str_filter: Filter string by pattern

View source: R/strings.R

str_filterR Documentation

Filter string by pattern

Description

A wrapper for stringr's str_detect that returns the matched values, or the non-matched values.

Usage

str_filter(string, pattern, reverse = F)

Arguments

string

(chr) A string.

pattern

(chr) Pattern to look for (regex).

reverse

(lgl) Whether to return the non-matched values instead (default no).

Value

A character vector.

Examples

str_filter(letters, pattern = "[aeiou]")
str_filter(letters, pattern = "[aeiou]", reverse = T)

Deleetdk/kirkegaard documentation built on April 22, 2024, 5:22 p.m.