www.gusucode.com > matlab 案例源码 matlab代码程序 > matlab/InsertTextAfterPositionInCharacterVectorExample.m

    %% Insert Text After Position in Character Vector
% Create a character vector and insert text after a specified position.
chr = 'mushrooms and onions'

%%
% Insert text after the ninth position.
newChr = insertAfter(chr,9,', peppers,')

%%
% Insert text after a substring.
newChr = insertAfter(chr,'mushrooms',', peppers,')