String Comparison C#


/ Published in: C#
Save to your folder(s)



Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.