%CONTAINS True if pattern is found in text.
%   TF = CONTAINS(STR,PAT) returns 1 (true) if STR contains PAT, and
%   returns 0 (false) otherwise.
%
%   STR must be text, which means it can be a string array, a character
%   vector, or a cell array of character vectors. PAT can be text or a
%   pattern array. PAT and STR need not have the same size. CONTAINS returns 
%   true if it finds any element of PAT in STR. If STR is a string array or 
%   cell array, then TF is a logical array that is the same size.
% 
%   TF = CONTAINS(STR,PAT,'IgnoreCase',IGNORE) ignores case when searching
%   for PAT in STR if IGNORE is true. The default value of IGNORE is false.
% 
%   Examples:
%       STR = "data.tar.gz";
%       PAT = "tar";
%       contains(STR,PAT)
%
%       % returns  1
%
%       STR = ["abstracts.docx","data.tar.gz"];
%       PAT = 'tar';         
%       contains(STR,PAT)
%
%       % returns  [0 1]
%
%       STR = ["thesis.docx","neverGonnaGiveYouUp.mp3"];
%       PAT = digitsPattern;         
%       contains(STR,PAT)
%
%       % returns  [0 1]
%
%       STR = 'data.tar.gz';
%       PAT = {'docx','tar'};
%       contains(STR,PAT)
%
%       % returns  1
%
%       STR ={'DATA.TAR.GZ','SUMMARY.PPT'};
%       PAT = "tar";
%       contains(STR,PAT,'IgnoreCase',true)
%
%       % returns  [1 0]
%
%   See also endsWith, startsWith, pattern, digitsPattern

%   Copyright 2015-2020 The MathWorks, Inc.