java 按照字符数分解字符串
假设按照50为分解标准
private LinkedList<String> splitAddress(String address) { LinkedList<String > addressList=new LinkedList<>(); int splitLength = address.length(); String s = address; while (splitLength >= 50) { String tmp = s.substring(0, 50); addressList.add(tmp); s = s.substring(50); splitLength = s.length(); } if (splitLength!=0){ addressList.add(s); } return addressList; }