%% Ignore Case When Testing End of String
% Create a string array that contains file names. Determine which file names end with the .gz extension, ignoring case.
% Starting in R2017a, you can create strings using double quotes.

str = ["DATA.TAR.GZ","mycode.m","SUMMARY.PPT","tmp.gz"]

%

pattern = ".gz";
TF = endsWith(str,pattern,'IgnoreCase',true)

%
% Display the file names that end with .gz. Index back into str using TF.

str(TF)

% Copyright 2012 The MathWorks, Inc.