%% Select Text with Inclusive and Exclusive Boundaries
% Select text from string arrays with boundaries that are forced to be inclusive or exclusive. extractBetween includes the boundaries with the selected text when the boundaries are inclusive. extractBetween does not include the boundaries with the selected text when the boundaries are exclusive.
% Create a string array. Starting in R2017a, you can create strings using double quotes.

str1 = "small|medium|large"

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

newStr = extractBetween(str1,6,13,'Boundaries','exclusive')

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

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

%

newStr = extractBetween(str2," brown","jumps",'Boundaries','inclusive')

% Copyright 2012 The MathWorks, Inc.