Last active
September 20, 2019 10:36
-
-
Save GroupDocsGists/b5738528abcc02850b5e1b6d062f55ef to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using GroupDocs.Redaction; | |
using GroupDocs.Redaction.Redactions; | |
... | |
using (Document doc = Redactor.Load("sample.docx")) | |
{ | |
doc.RedactWith(new ExactPhraseRedaction("John Doe", true /*isCaseSensitive*/, new ReplacementOptions("[censored]"))); | |
doc.Save(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using GroupDocs.Redaction; | |
using GroupDocs.Redaction.Redactions; | |
... | |
using (Document doc = Redactor.Load("sample.docx")) | |
{ | |
doc.RedactWith(new ExactPhraseRedaction("John Doe", new ReplacementOptions("[censored]"))); | |
doc.Save(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using GroupDocs.Redaction; | |
using GroupDocs.Redaction.Redactions; | |
... | |
using (Document doc = Redactor.Load("sample.docx")) | |
{ | |
// Regex to match a number having 2 digits, space, 2 digits, space, 6 digits | |
doc.RedactWith(new RegexRedaction(@"\\d{2}\\s*\\d{2}[^\\d]*\\d{6}", new ReplacementOptions("[censored]"))); | |
doc.Save(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using GroupDocs.Redaction; | |
using GroupDocs.Redaction.Redactions; | |
... | |
using (Document doc = Redactor.Load("sample.docx")) | |
{ | |
doc.RedactWith(new ExactPhraseRedaction("John Doe", true, new ReplacementOptions(System.Drawing.Color.Black))); | |
doc.Save(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment