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

str = ["DATA.TAR.GZ","data.xlsx","SUMMARY.PPT","tmp.gz"]

%

pat = "data";
TF = startsWith(str,pat,'IgnoreCase',true)

%
% Display the strings that start with data. Index back into str using TF.

str(TF)

% Copyright 2012-2020 The MathWorks, Inc.