grapes-w-grapes: Operator to Check if String is Part of Another String

%w%R Documentation

Operator to Check if String is Part of Another String

Description

The operator %w% checks if the string on the left-hand side is contained within the string on the right-hand side.

Usage

x %w% y

Arguments

x

A character string.

y

A character vector.

Value

A logical vector, TRUE if x is contained in a given element of y.

Examples

# Check if a string is part of
# another string
"A" %w% "ABC"
"D" %w% "ABC"

# Vectorized for y
"A" %w% c("ABC", "DEF", "GHI")

rettopnivek/arfpam documentation built on Oct. 20, 2024, 7:24 p.m.