Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Thu Aug 17, 2017 1:19 pm

Hello.

Is there any way to use the 'Document.Replace' method to make the replace only on the first occurrence?

For example: change 'o' from 'Hello Word' to 'Foo', but only the first 'o', thus: 'HellFoo Word'.

My version Spire.doc: 4.4.6.3040

maycon
 
Posts: 3
Joined: Mon Jul 24, 2017 1:25 pm

Fri Aug 18, 2017 4:05 am

Hello,

Thanks for your inquiry. Please set the 'Document.ReplaceFirst' property as true to make the replace only on the first occurrence.

Sincerely,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Return to Spire.Doc