title: C# equivalent of Python repr()
body: <p>Is there a C# method like Python's repr() to get the true representation of the object? Suppose we have:</p>
  
  <pre><code>string identifier = "22\n44";
  Console.WriteLine(identifier);
  </code></pre>
  
  <p>This would return</p>
  
  <pre>22
  44</pre> 
  
  <p>Is there a way to get </p>
  
  <pre><code>"22\n44"
  </code></pre>
  
  <p>In Python this is easy. We can just do <code>repr("22\n44")</code>.</p>
  
  <p>I thought of this question because I was trying to convert <code>"2244"</code> to <code>'2244'</code> using </p>
  
  <pre><code>var identifier = "2244";
  identifier = identifier.Replace("\"", "'");
  Console.WriteLine(identifier);
  </code></pre>
  
  <p>The output is just <code>2244</code>, because double quotes are for our purpose. But in my case, I  did this to get what I wanted:</p>
  
  <pre><code>identifier = string.Format("'{0}'", identifier);
  </code></pre>
  
  <p>because initially the database was receiving the query as <code>IN ("2244")</code> instead of <code>IN ('2244')</code> and was throwing Invalid Number error.</p>