Advertisement
Guest User

Untitled

a guest
Mar 24th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. using System;
  2.  
  3. bool Equals(string left, string right) => left?.Equals(right) ?? (right is null);
  4.  
  5. Console.WriteLine(Equals("ab", "ab") == true);
  6. Console.WriteLine(Equals("ab", "zx") == false);
  7. Console.WriteLine(Equals(null, null) == true);
  8. Console.WriteLine(Equals("ab", null) == false);
  9. Console.WriteLine(Equals(null, "ab") == false);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement