%% Select Substrings Between Start and End Positions
% Create string arrays and select substrings between start and end positions that are specified as numbers.
% Starting in R2017a, you can create strings using double quotes.

str = "Edgar Allen Poe"

%
% Select the middle name. Specify the seventh and 11th positions in the string.

newStr = extractBetween(str,7,11)

%
% Select substrings from each element of a string array. When you specify different start and end positions with numeric arrays, they must be the same size as the input string array.

str = ["Edgar Allen Poe";"Louisa May Alcott"]

%

newStr = extractBetween(str,[7;8],[11;10])

% Copyright 2012 The MathWorks, Inc.