%% Find Text
% Create a string array of names, where some names contain Paul.
% Starting in R2017a, you can create strings using double quotes.

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

%
% If you are using R2016b, create string arrays using the string function instead of double quotes.
% 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.

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

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

str(TF)

% Copyright 2012-2020 The MathWorks, Inc.