%% Update Multiple Pieces of Text
% Replace each occurrence of a double letter in a set of character vectors with the symbols '--'.

str = {                                 ...
'Whose woods these are I think I know.' ; ...
'His house is in the village though;'   ; ...
'He will not see me stopping here'      ; ...
'To watch his woods fill up with snow.'};

expression = '(.)\1';
replace = '--';
newStr = regexprep(str,expression,replace)

% Copyright 2012 The MathWorks, Inc.