Skip to contents

Return a logical vector indicating if elements of a character vector are blank (white spaces or empty strings).

Usage

is_blank(x)

Source

Adapted from xfun::is_blank() in the xfun package.

Arguments

x

A character vector.

Value

TRUE for blank elements, or FALSE otherwise.

Author

Yihui Xie xie@yihui.name (ORCID)

Examples

is_blank("")
#> [1] TRUE
is_blank("abc")
#> [1] FALSE
is_blank(c("", "  ", "\n\t"))
#> [1] TRUE
is_blank(c("", " ", "abc"))
#> [1] FALSE