C Sharp (C#) - LINQ Fundamentals
Find the issue in this code:
var list = new List<string> { "apple", "banana" };
var result = list.FirstOrDefault(x => x.StartsWith("c"));
Console.WriteLine(result.Length);Find the issue in this code:
var list = new List<string> { "apple", "banana" };
var result = list.FirstOrDefault(x => x.StartsWith("c"));
Console.WriteLine(result.Length);result.Length throws NullReferenceException.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions