%% Replace Substrings in Documents
% Replace words in a document array.

documents = tokenizedDocument([
    "an extreme example"
    "another extreme example"])
newDocuments = replace(documents,"example","sentence")

% Replace substrings of the words.

newDocuments = replace(documents,"ex","X-")

% Copyright 2012 The MathWorks, Inc.