Compare string vectors.

<!-- %like% -->
string_isblank(s)
string_isupper(s)
string_islower(s)

Arguments

s

A string (character) vector.

Value

Boolean vector.

Details

The function string_isblank() tests whether a vector consists of only blank characters. Synonyms are s_isblank(), isblank(), and is.blank().

The %like% operator tests whether a pattern match is found in a string.

The functions string_isupper() and string_islower() test whether each element in a string vector is all uppercase or lowercase, respectively. Synonyms are s_fun(), isfun(), and is.fun() (replace "fun" with "upper" or "lower").

See also

Examples

string_isblank(" ")
#> [1] TRUE
string_isblank(" string ")
#> [1] FALSE
rownames(mtcars) %like% "^M"
#> [1] TRUE TRUE FALSE FALSE FALSE FALSE FALSE TRUE TRUE TRUE TRUE TRUE #> [13] TRUE TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE #> [25] FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE
string_isupper(c('TEST', 'test', 'tEsT'))
#> [1] TRUE FALSE FALSE
string_islower(c('TEST', 'test', 'tEsT'))
#> [1] FALSE TRUE FALSE