%% Delete Text with Inclusive and Exclusive Boundaries
% Delete text from string arrays with boundaries that are forced to be inclusive or exclusive. eraseBetween deletes the boundaries when they are inclusive. eraseBetween returns the boundaries as part of the output string array when they are exclusive.
% Create a string array. Starting in R2017a, you can create strings using double quotes.

str = "small|medium|large"

%
% Delete the text between sixth and 13th positions, but do not delete the characters at those positions.

newStr = eraseBetween(str,6,13,'Boundaries','exclusive')

%
% Delete the text between two substrings, and also the substrings themselves.

str = "The quick brown fox jumps over the lazy dog"

%

newStr = eraseBetween(str," brown","lazy",'Boundaries','inclusive')

% Copyright 2012 The MathWorks, Inc.