以下是几个特殊字符的对应实体。
在C#中,直接调用C#提供的方法,保存之后就会自动将特殊字符转为对应实体:
< |
< |
小于号 |
> |
> |
大于号 |
& |
& |
和 |
' |
‘ |
单引号 |
" |
“ |
双引号 |
string s =
System.Security.SecurityElement.Escape(s);