Skip to content

Instantly share code, notes, and snippets.

@hperantunes
Last active December 8, 2021 22:04
Show Gist options
  • Save hperantunes/6898b13257615169c560d2e5bbe83e19 to your computer and use it in GitHub Desktop.
Save hperantunes/6898b13257615169c560d2e5bbe83e19 to your computer and use it in GitHub Desktop.
using System;
using System.Linq;
public class Program
{
public static void Main()
{
var a = new string[] { "something", "something else" };
var b = new string[] { "something", "something else" };
Console.WriteLine(a == b); // result is False, these 2 arrays don't have the same reference
Console.WriteLine(a.SequenceEqual(b)); // result is True, these 2 arrays have the same contents in the same order
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment