Skip to contents

Determine which strings within a vector of strings is either a string with no characters or a string comprised entirely of blanks. This function uses stringr::str_detect() and the regular expression "^[[:space:]]*$" to determine if the string contains no characters or all blanks.

Usage

is.BLANK(string)

Arguments

string

or vector of strings to evaluate.

Value

logical

Examples

string <- c("", " ", "  ", "   ", " abc", "abc ", " abc ")
is.BLANK(string=string)
#> [1]  TRUE  TRUE  TRUE  TRUE FALSE FALSE FALSE
# [1]  TRUE  TRUE  TRUE  TRUE FALSE FALSE FALSE