An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
Just add a select, which is the linq map function
writer.Write(String.Join(Environment.NewLine,
File.ReadAllLines(file)
.Where<string>(line => line..Contains(textToSearch, StringComparison.OrdinalIgnoreCase)
.Select( line => line + $” (from {textToSearch})”)
)));