Learn R Programming

stringi (version 1.2.2)

stri_isempty: Determine if a String is of Length Zero

Description

This is the fastest way to find out whether the elements of a character vector are empty strings.

Usage

stri_isempty(str)

Arguments

str

character vector or an object coercible to

Value

Returns a logical vector of the same length as str.

Details

Missing values are handled properly, as opposed to the built-in nzchar function.

See Also

Other length: stri_length, stri_numbytes, stri_width

Examples

Run this code
# NOT RUN {
stri_isempty(letters[1:3])
stri_isempty(c(',', '', 'abc', '123', '\u0105\u0104'))
stri_isempty(character(1))

# }

Run the code above in your browser using DataLab