I have a String:
String ints = "1, 2, 3";
I would like to convert it to a list of ints:
List<Integer> intList
I am able to convert it to a list of strings this way:
List<String> list = Stream.of("1, 2, 3").collect(Collectors.toList());
But not to list of ints.
Any ideas?
"1, 2, 3". Did you mean:Stream.of("1", "2", "3")?