Skip to content

isstrprop

Test whether characters belong to a named character category.

tf = isstrprop(str, category)

Returns a logical array the same size as str indicating which positions hold characters in the named category. Recognized categories include 'alpha', 'digit', 'alphanum', 'lower', 'upper', 'punct', 'wspace', 'cntrl', 'print', 'xdigit'.

isstrprop('Hi 5!', 'digit') % [0 0 0 1 0]
  • isletter — Test whether each character is alphabetic.
  • isspace — Test whether each character is whitespace.
  • ischar — Test whether the input is a character array.