str_contains: str_contains

Description Usage Arguments Value See Also Examples

View source: R/rpraat.R

Description

Find string in another string (without regular expressions), returns TRUE / FALSE.

Usage

1
str_contains(string, patternNoRegex)

Arguments

string

string in which we try to find something

patternNoRegex

string we want to find, "as it is" - no regular exprressions

Value

TRUE / FALSE

See Also

str_find, str_find1, isString

Examples

1
2
3
4
str_contains("Hello world", "wor")  # TRUE
str_contains("Hello world", "WOR")  # FALSE
str_contains(tolower("Hello world"), tolower("wor"))  # TRUE
str_contains("Hello world", "")  # TRUE

Example output

[1] TRUE
[1] FALSE
[1] TRUE
[1] TRUE

rPraat documentation built on Feb. 28, 2021, 1:06 a.m.