isstrprop
Determine which characters in input strings are of specified category
Description
determines if characters in the input text are of the specified category, such as
letters, numbers, or whitespace. For example,
TF
= isstrprop(str
,category
)isstrprop('ABC123','alpha')
returns a
1
-by-6
logical array, [1 1 1 0 0
0]
, indicating that the first three characters are letters.
If
str
is a character array, string scalar, or numeric array, thenisstrprop
returns a logical array.If
str
is a cell array of character vectors or a string array, thenisstrprop
returns a cell array of logical vectors.
Examples
Input Arguments
Output Arguments
Tips
Whitespace characters for which the wspace
option
returns true
include tab, line feed, vertical tab,
form feed, carriage return, and space, in addition to some other Unicode characters.
To see all characters for which the wspace
option
returns true
, enter the following command, and
then look up the returned decimal codes in a Unicode reference:
find(isstrprop(char(1):char(intmax('uint16')),'wspace'))
Extended Capabilities
Version History
Introduced before R2006a