Replace word struggeling

SyntaxEditor for Windows Forms Forum

Posted 8 years ago by Radjesh Klauke - X-impress
Avatar
Ola,

I have a small question regarding replacing a specific word in the text.

e.g:
txt_search.text = "lorem"
txt_replace.text = "blabla"

Sub btn_actionReplace_Click(...)...

' how do I simply replace "lorem" with "blabla"?
' or how do I make it as an "Option"?

End Sub

Thanks in advance.

[Modified at 12/14/2011 08:24 AM]

Comments (4)

Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Radjesh,

Please read the "SyntaxEditor Other Features / Find and Replace" documentation topic as that tells you how to do find/replace in SyntaxEditor.


Actipro Software Support

Posted 8 years ago by Radjesh Klauke - X-impress
Avatar
Uuuh, sorry, but I did before I asked here. Also looked at the samples.
Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Well per that topic you could use the document find/replace model like:
var options = new FindReplaceOptions() {
  FindText = "lorem",
  ReplaceText = "blabla"
};
editor.Document.FindReplace.ReplaceAll(options);


Actipro Software Support

Posted 8 years ago by Radjesh Klauke - X-impress
Avatar
Thanks. That will work. I understand now how to implement it.
The latest build of this product (v2018.1 build 0341) was released 9 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.