A
Angry Moth Town
Hi all. I'm fairly new to java. Is there a better or cleaner way to
convert a String to an ArrayList in Java 1.4 than this:
public static ArrayList stringToArrayList(String list, String
separator) {
String[] pieces = list.split(separator);
for (int i = pieces.length - 1; i >= 0; i--) {
pieces = pieces.trim();
}
return new ArrayList(Arrays.asList(pieces));
}
Thank you in advance.
convert a String to an ArrayList in Java 1.4 than this:
public static ArrayList stringToArrayList(String list, String
separator) {
String[] pieces = list.split(separator);
for (int i = pieces.length - 1; i >= 0; i--) {
pieces = pieces.trim();
}
return new ArrayList(Arrays.asList(pieces));
}
Thank you in advance.