【发布时间】:2023-03-11 23:17:01
【问题描述】:
寻找创建多个子字符串的最佳解决方案,以使每个子字符串的长度不超过参数中的长度值。当包含在子字符串中时,它应该将空格转换为指定的分隔符(让我们以逗号为例)并删除无关的空格。 示例:
input string = "Smoking is one of the leading causes of statistics"
length of substring = 7
result = "Smoking,is one,of the,leading,causes,of,statist,ics."
input string = "Let this be a reminder to you all that this organization will not tolerate failure."
length of substring = 30
result = "let this be a reminder to you,all that this organization_will not tolerate failure."
【问题讨论】:
-
你能告诉我们你到目前为止所做的尝试吗?
标签: c# substring fold delimited