%% Determine if Character Vector Contains Pattern
% Create a character vector that contains a list of foods. Determine whether the names of different foods are in the character vector.

chr = 'peppers, onions, and mushrooms';
TF = contains(chr,'onion')

%

TF = contains(chr,'pineapples')

% Copyright 2012 The MathWorks, Inc.