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(); }