Home > DeveloperSection > Forums > ConfigurationManager.AppSettings convert “\n” to “\\n” why?
jacob rasel
jacob rasel

Total Post:88

Posted on    August-22-2014 1:45 AM

 ASP.Net ASP.Net 

 1 Reply(s)
 903  View(s)
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 ?

Sumit Kesarwani

Total Post:378

Posted on    August-22-2014 2:10 AM

Hi Jacob, 
try this:

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

Don't want to miss updates? Please click the below button!

Follow MindStick