isspace
Determine which characters are space characters
Syntax
Description
TF = isspace(
returns a logical array
A
)TF
. If A
is a character array or string
scalar, then the elements of TF
are logical 1
(true
) where corresponding characters in A
are space characters, and logical 0
(false
)
elsewhere. isspace
recognizes all Unicode® whitespace characters.
If A
is not a character array or string scalar, then
isspace
returns logical 0
(false
). If A
is a non-scalar string
isspace
throws an error.
Examples
Input Arguments
Tips
To find space characters within elements of a nonscalar string array, use the
isstrprop
function.To find all characters for which
isspace
returns logical1
, use the code below. Then look up the returned decimal codes in a Unicode reference, such as the List of Unicode characters.find(isspace(char(1):char(intmax('uint16'))))
Extended Capabilities
Version History
Introduced before R2006a