title: Comparing Guid with string
body: <p>I'm surprised that I couldn't find an answer to this either in Google or here on SO, but what is the best way to compare a <code>string</code> to <code>Guid</code> taking into consideration case, and, if appropriate, performance</p>
  
  <pre><code>const string sid = "XXXXX-...."; // This comes from a third party library
  Guid gid = Guid.NewGuid(); // This comes from the db
  
  if (gid.ToString().ToLower() == sid.ToLower())
  
  if (gid == new Guid(sid))
  
  // Something else?
  </code></pre>
  
  <p><strong>Update:</strong>
  To make this question more compelling, I changed <code>sid</code> to a <code>const</code>... and since you can't have a <code>Guid const</code> this is the real problem I am dealing with.</p>