开发者

Remove HyperLinks from text

开发者 https://www.devze.com 2023-02-17 23:47 出处:网络
I need help with it and i\'m sure its simple but I cant figure it out. In my rich text box I copy a link in and I dont want it to be a hyperlink. 开发者_如何学运维

I need help with it and i'm sure its simple but I cant figure it out.

In my rich text box I copy a link in and I dont want it to be a hyperlink. 开发者_如何学运维

So how do I remove the hyperlink?


It seems you're asking about hyperlinks in the RichTextBox in Windows Forms. If so, it's simply a matter of setting the DetectUrls property to false:

richTextBox1.DetectUrls = false;


string BadInput=Textbox.Text....
string GoodInput=BadInput.Replace("<","&lt;").Replace(">","&gt;");

Of course, this is assuming you don't want any HTML to be allowed in the text box.

0

精彩评论

暂无评论...
验证码 换一张
取 消