%% Insert Text After Substring
% Create string arrays and insert text after substrings.
% Starting in R2017a, you can create strings using double quotes.

str = "The quick fox"

%
% If you are using R2016b, create string arrays using the string function instead of double quotes.
% Insert text after the substring "quick".

newStr = insertAfter(str,"quick"," brown")

%
% Insert substrings into each element of a string array. When you specify different substrings as positions, they must be contained in a string array or a cell array that is the same size as str.

str = ["The quick fox jumps";"over the dog"]

%

newStr = insertAfter(str,["quick";"the"],[" brown";" lazy"])

% Copyright 2012-2020 The MathWorks, Inc.