How to remove a bookmark content- without removing the bookmark itself

Hi, I’ve found this article about to remove a bookmark content:
https://blog.aspose.com/category/words

I need to develop a similar function, but I want to remove only the content of a specified bookmark and keep the bookmark itself.
How can the method be modified to remove only the content and not the bookmark itself?
Thank you!

Hello

Thanks for your request. Please see the following link to learn how to work with bookmarks using Aspose.Words:
https://docs.aspose.com/words/net/working-with-bookmarks/

To remove content of bookmark you should use code like the following:

doc.Range.Bookmarks["mybk"].Text = "";

Best regards,