%% Search for Multiple Patterns
% Create a string array that contains names. Determine which strings contain either Ann or Paul.
% Starting in R2017a, you can create strings using double quotes.

str = ["Mary Ann Jones","Christopher Matthew Burns","John Paul Smith"]

%

pattern = ["Ann","Paul"];
TF = contains(str,pattern)

%
% Display the strings that contain either Ann or Paul. Index back into str using TF.

str(TF)

% Copyright 2012 The MathWorks, Inc.