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

Total Post:88

Points:616
Posted on    August-22-2014 1:45 AM

 ASP.Net ASP.Net 
Ratings:


 1 Reply(s)
 649  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

Points:2694
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