| Programming and Data Types | ![]() |
Categorizing Characters Within a String
There are two functions for categorizing characters inside a string:
isletter determines if a character is a letter isspace determines if a character is whitespace (blank, tab, or new line) For example, create a string named mystring.
mystring = 'Room 401';
isletter examines each character in the string, producing an output vector of the same length as mystring.
A = isletter(mystring)
A =
1 1 1 1 0 0 0 0
The first four elements in A are 1 (true) because the first four characters of mystring are letters.
| Comparing for Equality Using Operators | Searching and Replacing | ![]() |