int ch; while((ch=myRead())!=-1){ //如果读到回车符,则结束本次循环,不将其拼接到sb中 if(ch =='\r') continue; //遇到换行符则返回当前字符串 if(ch =='\n') return sb.toString(); sb.append((char)ch); }
62,628
社区成员
307,259
社区内容
加载中
试试用AI创作助手写篇文章吧