title: C# Get file extension by content type
body: <p>How can I get file extension by content type ?</p>
  
  <p>Example I know that file is "text/css" so extension will be ".css".</p>
  
  <pre><code>private static string GetExtension(string contentType)
  {
      string ext = ".";
  
      { DETERMINATION CODE IN HERE }
  
      return ext;
  }
  </code></pre>