51
What will be the output of the following C# code snippet?
class Program
{
static void Main(string[] args)
{
string[] strs = { ".com", ".net", "facebook.com", "google.net",
"test", "netflix.net", "hsNameD.com" };
var netAddrs = from addr in strs
where addr.Length > 4 && addr.EndsWith(".net",
StringComparison.Ordinal)
select addr;
foreach (var str in netAddrs) Console.WriteLine(str);
Console.ReadLine();
}
} Answer & Solution
Answer: Option
D
No explanation is given for this question. Let's Discuss on Board