ConfigurationManager.AppSettings convert “\n” to “\\n” why?

Total Post:88

Points:616

 1338  View(s)
Ratings:
Rate this:

I have a AppSetting in web.config.

<add key="key" value="\n|\r"/>

When i read it by ConfigurationManager.AppSettings["key"] it gives "\\n|\\r". Why ?

  1. Re: ConfigurationManager.AppSettings convert “\n” to “\\n” why?

    Hi Jacob, 

    try this:

    ConfigurationManager.AppSettings["Key"].Replace("\\n", "\n")

Answer

Please check, If you want to make this post sponsored

You are not a Sponsored Member. Click Here to Subscribe the Membership.