List<String> list = new ArrayList<String>(Arrays.asList(string.split(" , ")));
// string.split also accept regular expressions
Java example to split a string
String str = "A-B-C-D";
String[] strArray = str.split("-");
System.out.println(Arrays.toString(strArray)); // [A, B, C, D]
String[] array = values.split("|", -1);
String str= "abcdef";
String[] array=str.split("(?<=G.{2})");
System.out.println(java.util.Arrays.toString(array));
List<String> list = new ArrayList<String>(Arrays.asList(scanner.nextLine().split(", ")));