【问题标题】:Split a long String in c# without breaking a words [duplicate]在c#中拆分一个长字符串而不破坏一个单词[重复]
【发布时间】:2013-03-14 17:33:10
【问题描述】:

我想在 c# 中打断一个长字符串而不打断一个单词 示例:S AAA BBBBBBB CC DDDDDD V 7 计数中断字符

S AAA 
BBBBBBB
CC 
DDDDDD 

【问题讨论】:

    标签: c# c#-4.0 c#-3.0 c#-2.0 c#-5.0


    【解决方案1】:

    利用substring函数c#

    此链接可能对您有所帮助。

    http://www.dotnetperls.com/substring

    http://msdn.microsoft.com/en-IN/library/system.string.substring%28v=vs.71%29.aspx

    count=0;
    for(int i=0;i<str.Length;i++)
    {
     if(str.Length%7==0)
     input.Substring(count, 7);
     count++;
    }
    

    希望你能应用更多关于它的逻辑。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-28
      • 2019-11-01
      相关资源
      最近更新 更多