【文件属性】:
文件名称:关于C#字符处理一点小东西
文件大小:7KB
文件格式:TXT
更新时间:2011-09-26 15:52:13
字符串处理
///
///将字符串格式化为HTML
///
///
所要格式化的字符串
///
返回格式化后的HTML代码
public static string FormatToHtml(string normalStr)
{
normalStr = System.Web.HttpContext.Current.Server.UrlDecode(normalStr);
normalStr = System.Web.HttpContext.Current.Server.HtmlEncode(normalStr);
StringBuilder html = new StringBuilder(normalStr);
html.Replace(" ", " ");
html.Replace("\r\n", "
");
return html.ToString();
}
/**/
///
/// 将HTML转为普通文本格式