Aspose.Words - Find and Replace Text in Documents

// Replaces all 'sad' and 'mad' occurrences with 'bad'
doc.getRange().replace("sad", "bad", false, true); 

// Replaces all 'sad' and 'mad' occurrences with 'bad'
doc.getRange().replace(Pattern.compile("[s|m]ad"), "bad");

Download Source Code
For More Examples, Please Visit Aspose Docs

Last edited May 30, 2014 at 4:17 AM by shoaibkhan, version 4