how to write the list of array values to the txt file (list of file names) :   **I have list of values(file names), i just splitted and assigned to the variable now i need to write the 2 set of file names to the individual files.** 


                //Split the Files
                var Alternated = Files
                                .Select((name, index) => new { name, index })
                                .GroupBy(item => item.index % 2, item => item.name)
                                .Select(group => group.ToList())
                                .ToArray();

                //Assigning alternate files to the variable  
                var C1 = Alternated[0];
                var C2 = Alternated[1];

                // Check if file already exists. If yes, delete it.   
                string filepath = FilePath; 
                string filepath2 = FilePath2; 
                if (File.Exists(filepath) || File.Exists(filepath2))
                {
                    File.Delete(filepath);
                    File.Delete(filepath2);
                }
                using (FileStream fs = File.Create(filepath))
                {
                    StreamWriter sw = new StreamWriter(fs);
                    C1.ForEach(r => sw.WriteLine(r));
                    
                }
             using (FileStream fs1 = File.Create(filepath1))
                {
                    StreamWriter sw1 = new StreamWriter(fs1);
                    C2.ForEach(r => sw.WriteLine(r));
                    
                }