§ ITPOW >> 文档 >> C#

HtmlEncode 等遇到 null 参数的情况

作者:vkvi 来源:ITPOW(原创) 日期:2021-7-14
Response.Write(null); // 正常运行
Response.Write(HttpUtility.HtmlEncode(null)); // 正常运行
string.Format("{0}", null); // 出错

以上是 Response.Write、HttpUtility.HtmlEncode、string.Format 遇到 null 参数的情况。

相关文章