diff --git a/X10D/src/StringExtensions.cs b/X10D/src/StringExtensions.cs index d4145d3..e80f2c4 100644 --- a/X10D/src/StringExtensions.cs +++ b/X10D/src/StringExtensions.cs @@ -204,9 +204,14 @@ throw new ArgumentNullException(nameof(str)); } - for (var i = 0; i < str.Length; i += chunkSize) + return SplitInternal(); + + IEnumerable SplitInternal() { - yield return str.Substring(i, Math.Min(chunkSize, str.Length - i)); + for (var i = 0; i < str.Length; i += chunkSize) + { + yield return str.Substring(i, Math.Min(chunkSize, str.Length - i)); + } } }