title: Is it necessary to escape a backslash in a config file
body: <p>Say I have the following string:</p>
  
  <pre><code>c:\testmypath
  </code></pre>
  
  <p>In C#, if I want to use that inside code without a tab appearing inside it, I can do the following:</p>
  
  <pre><code>string t = @"c:\testmypath";
  </code></pre>
  
  <p>However, if I want to read this from a configuration file; let's say an <code>appsettings.json</code> that looks like this:</p>
  
  <pre><code>{
    "MyPath": "c:\testmypath"
  }
  </code></pre>
  
  <p>The following code results in a tab being displayed in the console:</p>
  
  <pre><code>static void Main(string[] args)
  {
      var path = returnString();
  
      Console.WriteLine(path);
      Console.ReadLine();
  }
  
  
  static string returnString()
  {
      var builder = new ConfigurationBuilder()
          .SetBasePath(Directory.GetCurrentDirectory())
          .AddJsonFile("appsettings.json");
  
      var configuration = builder.Build();
  
      return configuration["MyPath"];            
  }
  </code></pre>
  
  <p>I can fix this by escaping the path inside the config file; for example:</p>
  
  <pre><code>{
    "MyPath": "c:\\testmypath"
  }
  </code></pre>
  
  <p>By, can I escape the single slash version somehow?  I've tried:</p>
  
  <pre><code>return @configuration["MyPath"];            
  </code></pre>
  
  <p>Which, to my surprise, does compile, but has no effect.  I've also tried <code>.ToString()</code>, although I'm not sure why I thought that would work.</p>