andrew4582

String Equals Ignore Case

Nov 6th, 2013
284
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.30 KB | None | 0 0
  1.         public static bool EqualsIgnoreCase(this string a, string b)
  2.         {
  3.             if (a == null && b == null)
  4.                 return true;
  5.             if (a != null && b == null)
  6.                 return false;
  7.             if (a == null && b != null)
  8.                 return false;
  9.             return string.Equals(a, b, StringComparison.InvariantCultureIgnoreCase);
  10.         }
Advertisement
Add Comment
Please, Sign In to add comment