加一个判断就好了; String [] strs = str.split(" "); if (strs.length==0) return str;//多个空格的情况
2

相关推荐

牛客网
牛客网在线编程
牛客网题解
牛客企业服务