Learn R Programming

Ecfun (version 0.2-2)

nchar0: Zero characters or NULL

Description

Returns TRUE if (is.null(x) || (length(x) == 0) || (max(nchar(x)) == 0)).

Usage

nchar0(x, ...)

Arguments

x

a character vector or something that can be coerced to mode character

optional arguments to be passed to nchar

Value

TRUE if x is either NULL or max(nchar(x)) == 0. FALSE otherwise.

See Also

nchar

Examples

Run this code
# NOT RUN {
all.equal(nchar0(NULL), TRUE)
# }
# NOT RUN {
# }
# NOT RUN {
all.equal(nchar0(character(0)), TRUE)
# }
# NOT RUN {
# }
# NOT RUN {
all.equal(nchar0(character(3)), TRUE)
# }
# NOT RUN {
# }
# NOT RUN {
all.equal(nchar0(c('a', 'c')), FALSE)
# }

Run the code above in your browser using DataLab