如果split最后一个为空,则要这么写 String[] lines=line.split(",",-1); 转载于:https://www.cnblogs.com/JAYIT/p/9295454.html