逃生字符串中的字符 [英] Escape & character in string
本文介绍了逃生字符串中的字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想设置值appconfig键,但值包含&角色。我尝试过双重&&像这样的 8L&& L26X0s8 @ P,但不起作用。能帮我吗?
I want to set value appconfig key,but value contains & character.I tried double && like this "8L&&L26X0s8@P" but dont working.Can you help me please?
<add key="SAP_PASS" value="8L&L26X0s8@P"/>
推荐答案
为 app.config
是 xml
文件,为此使用 XML
实体。
As app.config
is xml
file, use XML
entities for this.
具体地,&
在<&
(包括分号)中被编码为 XML
。
Specifically &
is coded as &
(including the semicolon) in XML
.
这篇关于逃生字符串中的字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文