From d5cedcf1cf2e04fcf83aa5889c5c11ff96e5ab19 Mon Sep 17 00:00:00 2001 From: KingLuigi4932 Date: Thu, 31 Aug 2017 23:54:34 -0700 Subject: [PATCH] Fixing WriteAllLines issue --- .../System/IO/FileImpl.cs | 29 ++++++++++++------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/source/Cosmos.System2_Plugs/System/IO/FileImpl.cs b/source/Cosmos.System2_Plugs/System/IO/FileImpl.cs index 86c048bc9..b66c46dbe 100644 --- a/source/Cosmos.System2_Plugs/System/IO/FileImpl.cs +++ b/source/Cosmos.System2_Plugs/System/IO/FileImpl.cs @@ -120,18 +120,25 @@ namespace Cosmos.System_Plugs.System.IO return result; } - public static void WriteAllLines(string aFile, IEnumerable contents) + /* public static void WriteAllLines(string aFile, IEnumerable contents) + * { + * string text = null; + * + * foreach (var line in contents) + * { + * text = string.Concat(text, line, Environment.NewLine); + * } + * + * Global.mFileSystemDebugger.SendInternal("Writing contents"); + * Global.mFileSystemDebugger.SendInternal(text); + * + * WriteAllText(aFile, text); + * } + */ + + public static void WriteAllLines(string aFile, string[] contents) { - string text = null; - - foreach (var line in contents) - { - text = string.Concat(text, line, Environment.NewLine); - } - - Global.mFileSystemDebugger.SendInternal("Writing contents"); - Global.mFileSystemDebugger.SendInternal(text); - + string text = String.Join(Environment.NewLine, contents); WriteAllText(aFile, text); }