3

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"/>
0

3 Answers 3

8

As app.config is xml file, use XML entities for this.

Specifically & is coded as &amp; (including the semicolon) in XML.

Sign up to request clarification or add additional context in comments.

Comments

1

You can escape any character using Regex.Escape(string)

Comments

0

have you tried &amp ? This is the usual escape

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.