%% Delete Substrings from String Array
% Create a string array and delete substrings from it. Starting in R2017a, you can create strings using double quotes.

str = ["the quick brown fox jumps";
       "over the lazy dog"]

%
% If you are using R2016b, create string arrays using the string function instead of double quotes.
% Delete the substring "the " from str. The erase function deletes both instances.

newStr = erase(str,"the ")

%
% Delete multiple substrings from str.

match = ["the ","quick ","lazy "];
newStr = erase(str,match)

% Copyright 2012-2020 The MathWorks, Inc.