C# Lambda Expression Troubles


I am trying to create a query that returns a string for several programming languages. So far, I have gotten this error:

Program.cs(28,51): error CS1929: ‘Language’ does not contain a definition for ‘Contains’ and the best extension method overload ‘MemoryExtensions.Contains(ReadOnlySpan, string)’ requires a receiver of type ‘ReadOnlySpan’ [/home/ccuser/workspace/csharp-programming-languages/ProgrammingLanguages.csproj]

The build failed. Fix the build errors and run again.

I have tried to work with Contains(), though that isn’t accepted regardless of how I try to acquire the data, using some basic fundamentals of queries. Please examine my work and give me advice on what could improve it:

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;

namespace ProgrammingLanguages
class Program
static void Main()
List languages = File.ReadAllLines(“./languages.tsv”)
.Select(line => Language.FromTsv(line))

  foreach (var l in languages)

  var languageString = languages.Select(language => $"{language.Year}, {language.Name}, {language.ChiefDeveloper}");

/* foreach (var lString in languageString)
var languageC = languages.Where(language => language.Contains(“C#”));

  foreach (var lC in languageC)



This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.