Posted By

stewshack on 08/06/10


Tagged

Net csharp Framework


Versions (?)

Who likes this?

4 people have marked this snippet as a favorite

roli000
Tyster
Priestd09
Beppoi


String Comparison C#


 / Published in: C#
 

  1. string DeathStar = "That's no moon";
  2.  
  3. // Here's the best way to compare strings.
  4. // http://msdn.microsoft.com/en-us/library/ms973919.aspx
  5.  
  6. if (string.Compare(DeathStar, "THAT'S NO MOON",
  7. StringComparison.OrdinalIgnoreCase) == 0)
  8. {
  9. Wookie Chewie = new Wookie();
  10. Chewie.GetUsOuttaHere();
  11. }

Report this snippet  

You need to login to post a comment.