%% Search for Single Pattern
% Create a string array that contains names. Determine which strings contain Paul.
% Starting in R2017a, you can create strings using double quotes.

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

%
% Return a logical array where the position of each element equal to 1 corresponds to the position of a string in str that contains Paul.

pattern = "Paul";
TF = contains(str,pattern)

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

str(TF)

% Copyright 2012 The MathWorks, Inc.