Determine which characters are space characters
Arguments
- A
a character array or a string scalar
Value
a vector TF such that the elements of TF are logical 1 (true) where
corresponding characters in A are space characters, and logical 0 (false)
elsewhere.
Note
Recognized whitespace characters are
and \\t
.
Examples
chr <- "123 Main St."
X <- "\t a b\tcde f"
isspace(chr)
#> [1] 0 0 0 1 0 0 0 0 1 0 0 0
isspace(X)
#> [1] 1 1 0 1 0 1 0 0 0 1 0