Answers for "convert string to List object java"

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 "convert string to List object java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language