【发布时间】:2012-09-18 14:29:20
【问题描述】:
我有以下字符串:
string s = "The Electors shall meet in their respective states to vote by ballot for President and Vice-President.";
我想获取前 60 个字符并将它们分成两个单独的字符串,每个字符串不超过 30 个字符。每个字符串必须以整个单词开头(没有部分单词,也没有空格)。所以这是想要的结果:
string s1 = "The Electors shall meet in"; // 26 characters
string s2 = "their respective states to vot"; // 30 characters
谢谢。
【问题讨论】:
-
这个问题已经在这里stackoverflow.com/questions/4398270/…回答了。
标签: c# asp.net vb.net visual-studio