将读出的数据中的换行符用<br>或<p>替换!--------------------------------
AspNetPager 免费分页控件4.1版发布,欢迎下载使用:http://www.webdiyer.com

解决方案 »

  1.   

    str=str.Replace("\n","<br>");
    return str;
      

  2.   

    要使用ubb转换其中的某些回车、空格
      

  3.   

    写个转换函数吧
    function changechr(str) 
        changechr=replace(replace(replace(replace(str,"<","&lt;"),">","&gt;"),chr(13),"<br>")," ","&nbsp;") 
        changechr=replace(replace(replace(replace(changechr,"[ms]","<img src="),"","<b>"),"[red]","<font color=CC0000>"),"[big]","<font size=7>") 
        changechr=replace(replace(replace(replace(changechr,"[/ms]","></img>"),"","</b>"),"[/red]","</font>"),"[/big]","</font>") 
    end function
      

  4.   

    try:you can using following method to replace your news text.string myNewsBody = xxx.yyy; // this is your news body, and then call method of TextReplace(); e.g.
    TextReplace(myNewsBody);-----------------------------------------------------------
    private string TextReplace(string text)
    {
    text = text.Replace("\n", "<br />");
    text = text.Replace("\t", "&nbsp;&nbsp;&nbsp;&nbsp;"); return text;
    }
      

  5.   

    \n  //--> New line
    \t  //--> Tabyou can using this method to replace more characters, for example:text = text.Replace("", "<b>");
    text = text.Replace("", "</b>"); // etc.