工作笔记20140114 字符串编码 返回转换是否成功的标志
if (strValue != null)
{
// 将输入字符串编码,这样所有的HTML标签都失效了。
StringBuilder sb = new StringBuilder(System.Web.HttpUtility.HtmlEncode(strValue.ToString()));
// 然后我们选择性的允许某些标签,比如<b> 和 <i>
sb.Replace("<b>", "<b>");
sb.Replace("</b>", "</b>");
sb.Replace("<i>", "<i>");
sb.Replace("</i>", "</i>");
return sb.ToString();
}
else
return null;
DateTime.TryParse(strValue.ToString(), out rtnValue)
返回转换是否成功的标志
http://www.cnblogs.com/aehyok/p/3505000.html
浙公网安备 33010602011771号