📅  最后修改于: 2022-03-11 14:48:41.609000             🧑  作者: Mango
static IEnumerable ChunksUpto(string str, int maxChunkSize) {
for (int i = 0; i < str.Length; i += maxChunkSize)
yield return str.Substring(i, Math.Min(maxChunkSize, str.Length-i));
}