日期:2014-05-20 浏览次数:20786 次
public void delete(String input) { LinkedStack<String> addrStack = splitStr(input); ...... } private static LinkedStack<String> splitStr(String input) { LinkedStack<String> addrStack = new LinkedStack<String>(); String[] s = input.split("\\."); for (int i = 0; i < s.length; i++) { if (i != s.length - 1) addrStack.push(s[i] + "."); else addrStack.push(s[i]); } return addrStack; }