ExactPhraseRedaction Class
Represents a text redaction that replaces exact phrase in the document's text, case insensitive by default.
Inheritance Hierarchy

Namespace: GroupDocs.Redaction.Redactions
Assembly: GroupDocs.Redaction (in GroupDocs.Redaction.dll) Version: 20.7
Syntax
public class ExactPhraseRedaction : TextRedaction

The ExactPhraseRedaction type exposes the following members.

Constructors
  NameDescription
Public methodExactPhraseRedaction(String, ReplacementOptions)
Initializes a new instance of ExactPhraseRedaction class in case insensitive mode.
Public methodExactPhraseRedaction(String, Boolean, ReplacementOptions)
Initializes a new instance of ExactPhraseRedaction class.
Properties
  NameDescription
Public propertyActionOptions
Gets the ReplacementOptions instance, specifying type of text replacement.
(Inherited from TextRedaction.)
Public propertyDescription
Returns a string, describing the redaction and its parameters.
(Overrides RedactionDescription.)
Public propertyIsCaseSensitive
Gets a value indicating whether the search is case-sensitive or not.
Public propertySearchPhrase
Gets the string to search and replace.
Methods
  NameDescription
Public methodApplyTo
Applies the redaction to a given format instance.
(Overrides RedactionApplyTo(DocumentFormatInstance).)
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodToString (Inherited from Object.)
Remarks
Learn more
Examples
The following example demonstrates performing case-sensitive phrase search and replacement.
C#
using (Redactor redactor = new Redactor(@"C:\sample.pdf"))
{
  // By default, isCaseSensitive = false;
  doc.Apply(new ExactPhraseRedaction("John Doe", true /*isCaseSensitive*/, new ReplacementOptions("[personal]")));
  doc.Save();
}
The following example demonstrates replacing phrase (case insensitive) with solid red rectangle.
C#
using (Redactor redactor = new Redactor(@"C:\sample.pdf"))
{
  // By default, isCaseSensitive = false;
  doc.Apply(new ExactPhraseRedaction("John Doe", new ReplacementOptions(System.Drawing.Color.Red)));
  doc.Save();
}
See Also