当前位置: 移动技术网 > IT编程>开发语言>.net > Asp.Net文本换行

Asp.Net文本换行

2018年04月25日  | 移动技术网IT编程  | 我要评论

汉代铜器,行长请放手,金庸群侠传4

private string htmlcode(string tstring)
    {
        if (tstring != null)
        {
            tstring = tstring.replace("\r", "<br>");
            tstring = tstring.replace(" ", " ");
            return tstring;
        }
        else
        {
            return tstring="无内容";
        }
    }
使用范例:
this.contenttxt.text = htmlcode(newstab.rows[0]["contenttxt"].tostring());  
注:.contenttxt为label标签控件;newstab.rows[0]["contenttxt"].tostring()为读取数据库表中的记录集。

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网