Answers for "string to list java 15"

1

convert string to list java 8

String txt="Hello World I am a text";
List<String> seperated=Arrays.asList(txt.split(" "));
System.out.println(seperated);//[Hello, World, I, am, a, text]
Posted by: Guest on April-06-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language