Question
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();
}
}
a.
Compile time error
b.
Run time error
c.
facebook.com
netflix.net
google.net
d.
google.net
netflix.net
Posted under C# programming
netflix.net
Engage with the Community - Add Your Comment
Confused About the Answer? Ask for Details Here.
Know the Explanation? Add it Here.
Q. For the given set of codes, what is the output?
Similar Questions
Discover Related MCQs
Q. Choose the namespace in which Expression trees are encapsulated:
View solution
Q. Select the namespace which should be included while making use of LINQ operations:
View solution
Q. Can we use linq to query against a DataTable?
View solution
Q. Choose the namespace in which the interface IEnumerable is declared?
View solution
Q. Choose the wrong statement about the LINQ?
View solution
Q. Assume 2 columns named as Product and Category how can be both sorted out based on first by category and then by product name?
View solution
Suggested Topics
Are you eager to expand your knowledge beyond C# programming? We've curated a selection of related categories that you might find intriguing.
Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!