提交 0fd224b3 编写于 作者: sj452857582's avatar sj452857582

循环中查找的空格,如果填充的也是空格就死循环了

上级 9e987425
......@@ -232,7 +232,7 @@ public String replaceSpace(StringBuffer str) {
int P1 = str.length() - 1;
for (int i = 0; i < str.length(); i++)
if (str.charAt(i) == ' ')
str.append(" ");
str.append("aa");
int P2 = str.length() - 1;
while (P1 >= 0 && P2 > P1) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册