(String line, String sptr)
| 141 | List<String> cols = Util.Split(line, "\t"); |
| 142 | * */ |
| 143 | public static List<String> Split(String line, String sptr) { |
| 144 | |
| 145 | List<String> strs = null; |
| 146 | if (line == null || sptr == null || line.isEmpty()) |
| 147 | return strs; |
| 148 | |
| 149 | strs = new ArrayList<String>(); |
| 150 | int pos = line.indexOf(sptr); |
| 151 | if (sptr.isEmpty() || pos == -1) { |
| 152 | strs.add(line); |
| 153 | return strs; |
| 154 | } |
| 155 | |
| 156 | int begin = 0; |
| 157 | while (pos != -1) { |
| 158 | strs.add(line.substring(begin, pos)); |
| 159 | begin = pos + sptr.length(); |
| 160 | pos = line.indexOf(sptr, begin); |
| 161 | } |
| 162 | strs.add(line.substring(begin)); |
| 163 | |
| 164 | return strs; |
| 165 | } |
| 166 | |
| 167 | public static Vector<String> ParseIp(String val) { |
| 168 | Vector<String> res = new Vector(); |
no outgoing calls