I would like to convert the below \"foreach\" statement to a LINQ query that returns a substring of the file name into a list:
IList fileNameSu
Try something like this:
var fileList = files.Select(file => file.Name.Substring(0, file.Name.Length - (file.Name.Length - file.Name.IndexOf(".config.xml")))) .ToList();