Stack Overflow archive
0 score

Regex for splitting string into arraylist in java

score
0
question views
1.4K
license
CC BY-SA 3.0

It looks like an easy solution if this is the only String you are attempting to split.

Something like this would work for the input String you provided in your question:

java
List<String> myList = Arrays.asList(yourString.split(","));

You can use http://regexpal.com/ to help you in the future.

Originally posted on Stack Overflow. Public user contributions are licensed under Creative Commons Attribution-ShareAlike.