我正在尝试将一大串文本分成几个较小的文本字符串,并将每个较小的文本字符串的最大长度定义为不同。例如:
"The quick brown fox jumped over the red fence.
The blue dog dug under the fence."
我希望有可以将其拆分为较小行的代码,并且第一行最多为 5 个字符,第二行最多为 11 个字符,其余的最多为 20 个字符,结果如下:
Line 1: The
Line 2: quick brown
Line 3: fox jumped over the
Line 4: red fence.
Line 5: The blue dog
Line 6: dug under the fence.
所有这些都在 C# 或 MSSQL 中,有可能吗?