FindReplaceOptionsMatchCase Property

True indicates case-sensitive comparison, false indicates case-insensitive comparison.

Namespace:  Aspose.Words.Replacing
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 20.3
Syntax
public bool MatchCase { get; set; }

Property Value

Type: Boolean
Examples
Simple find and replace operation.
// Open the document
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

builder.Writeln("Hello _CustomerName_,");

// Check the document contains what we are about to test
Console.WriteLine(doc.FirstSection.Body.Paragraphs[0].GetText());

FindReplaceOptions options = new FindReplaceOptions();
options.MatchCase = false;
options.FindWholeWordsOnly = false;

// Replace the text in the document
doc.Range.Replace("_CustomerName_", "James Bond", options);

// Save the modified document
doc.Save(ArtifactsDir + "Range.ReplaceSimple.docx");
See Also