We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Replacing multiple occurrences of |_|


I needed to know if there is a way to replace multiple occurrences of | * | with TEXT.*


I have a document that has the following lines:

Hi |||||
How are you |||

I need to replace both the instances (|||||, ||_|) with TEXT

Thanks for your request. I think in your case you can try using Replace method. Please see the following link to learn more:
Also please see the following simple code:

Document doc = new Document("C:\\Temp\\in.docx");
doc.Range.Replace("|_|_|_|_|", "Andrey", false, false);
// Save output document.

The input and the output documents are attached.
Best regards,