(String str, String separators)
| 279 | } |
| 280 | |
| 281 | public static String[] split(String str, String separators) |
| 282 | { |
| 283 | if (str != null && str.length() > 0) |
| 284 | { |
| 285 | if (separators == null) |
| 286 | { |
| 287 | return new String[] {str}; |
| 288 | } |
| 289 | else |
| 290 | { |
| 291 | List list = new ArrayList(); |
| 292 | int i = 0; |
| 293 | |
| 294 | for (int j = 0; j < str.length(); ++j) |
| 295 | { |
| 296 | char c0 = str.charAt(j); |
| 297 | |
| 298 | if (equals(c0, separators)) |
| 299 | { |
| 300 | list.add(str.substring(i, j)); |
| 301 | i = j + 1; |
| 302 | } |
| 303 | } |
| 304 | |
| 305 | list.add(str.substring(i, str.length())); |
| 306 | return (String[])((String[])list.toArray(new String[list.size()])); |
| 307 | } |
| 308 | } |
| 309 | else |
| 310 | { |
| 311 | return new String[0]; |
| 312 | } |
| 313 | } |
| 314 | |
| 315 | private static boolean equals(char ch, String matches) |
| 316 | { |
no test coverage detected