%% Enforce Case Sensitivity
% Use caseSensitivePattern to enforce case sensitivity in case-insensitive functions.
% Create a string of lowercase letters. Create a pattern that matches uppercase "ABC". When used in a case-insensitive function, pat matches txt.

txt = "abc";
pat = "ABC";
contains(txt,pat,'IgnoreCase',true)

% Use caseSensitivePattern to enforce case-sensitivity in matching for pat even when used as the input for a case-insensitive function.

pat = caseSensitivePattern(pat);
contains(txt,pat,'IgnoreCase',true)

% Copyright 2020 The MathWorks, Inc.