From 9656918a408fe246937fb00a29ec1c430b1c793e Mon Sep 17 00:00:00 2001 From: Timerix Date: Fri, 15 Oct 2021 23:06:27 +0300 Subject: [PATCH] 033 --- FrameworkFix.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/FrameworkFix.cs b/FrameworkFix.cs index 79caea5..2413c24 100644 --- a/FrameworkFix.cs +++ b/FrameworkFix.cs @@ -125,16 +125,16 @@ namespace DTLib builder.Append(parts[i].ToString()); return builder.ToString(); } - public static string MergeToString(this ICollection collection, string separator) + public static string MergeToString(this IEnumerable collection, string separator) { - if(collection.Count==0) - return ""; StringBuilder builder = new(); foreach(T elem in collection) { builder.Append(elem.ToString()); builder.Append(separator); } + if (builder.Length==0) + return ""; builder.Remove(builder.Length-separator.Length, separator.Length); return builder.ToString(); }