%% Insert Text Before Position in Character Vector
% Create a character vector and insert text before a specified position.

chr = 'mushrooms and onions'

%
% Insert text before the tenth position.

newChr = insertBefore(chr,10,', peppers,')

%
% Insert text before a substring.

newChr = insertBefore(chr,' and',', peppers,')

% Copyright 2012 The MathWorks, Inc.