%% Replace Text Between Positions in Character Vector
% Create a character vector and replace text between start and end positions.

chr = 'mushrooms, peppers, and onions'

%

newChr = replaceBetween(chr,12,18,'pineapple')

%
% Replace text between substrings.

newChr = replaceBetween(chr,'mushrooms,',' and',' extra cheese,')

% Copyright 2012 The MathWorks, Inc.