如何让我的richtextbox自动生成paragrafs? [英] How do I make my richtextbox make paragrafs automatically?
本文介绍了如何让我的richtextbox自动生成paragrafs?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想制作一个程序,将纯文本转换为html中的特定格式,但我不能这样做,因此它识别paragraf的位置,然后将其转换为'< br \>'。
有什么想法吗?
谢谢
我尝试了什么:
我试过添加< br \>在每个点(。)之后,然后文本将变短,并尝试识别,但它只是不起作用。
I want to make a program to convert plain text to a specific format in html, but i can't make it so it recognizes where the paragraf is and then turn it into a '<br \>'.
Any ideas?
Thanks
What I have tried:
I've tried adding a <br \> after every dot (.), but then the text would be to short, and tried to recognized the " ", but it just didn't work.
推荐答案
如果你只是想用你的休息替换新的行字符,试试这个:
If you are just looking to replace new line characters with your break, try this:
private string Convert(string input)
{
return input.Replace(Environment.NewLine, "<br/>");
}
这篇关于如何让我的richtextbox自动生成paragrafs?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文