尝试这样的事情:
var fileList = files.Select(file => file.Name.Substring(0, file.Name.Length - (file.Name.Length - file.Name.IndexOf(".config.xml")))) .ToList();