%% Match Whitespace Characters
% Use whitespacePattern to match nonstandard whitespace characters like char(160).
% Create a cell array of character vectors that each contain a different whitespace character including tab and newline characters.

whitespaces = {' ' char(9) newline char(32) char(160)}

% Build a pattern that matches whitespace characters using whitespacePattern. Determine which character vectors contain whitespace valid characters using contains.

pat = whitespacePattern;
contains(whitespaces,pat)

% Copyright 2020 The MathWorks, Inc.