Replace Text with Footnote Indicators

I am having an issue replacing text with attached footnotes. Is it possible to find the text without including the attached footnote?

For example, I’ll upload a small word document.
test-replace.docx (15.9 KB)

var howMany = replaceTesting.Range.Replace("), a Swiss citizen ", "test"); // howMany = 0

How can I get this replacement to work?

@chrisbluemorgan You can use FindReplaceOptions.IgnoreFootnotes option:

Document doc = new Document(@"C:\Temp\in.docx");

FindReplaceOptions opt = new FindReplaceOptions();
opt.IgnoreFootnotes = true;
int howMany = doc.Range.Replace("), a Swiss citizen ", "test", opt); 
Console.WriteLine(howMany); // howMany = 1

doc.Save(@"C:\Temp\out.docx");