Skip to content

Instantly share code, notes, and snippets.

@saga
Created July 29, 2011 05:01
Show Gist options
  • Save saga/1113163 to your computer and use it in GitHub Desktop.
Save saga/1113163 to your computer and use it in GitHub Desktop.
IEnumerable<string> strings = new List<string>();
if (strings is IEnumerable<object>)
Console.WriteLine("True");
else
Console.WriteLine("False");
/// why this is False??
if (strings is IList<object>)
Console.WriteLine("True");
else
Console.WriteLine("False");
if (strings is IEnumerable<string>)
Console.WriteLine("True");
else
Console.WriteLine("False");
if (strings is IList<string>)
Console.WriteLine("True");
else
Console.WriteLine("False");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment