VOOZH about

URL: https://www.geeksforgeeks.org/java/splitter-splittolist-method-guava-java/

⇱ Splitter splitToList() method | Guava | Java - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Splitter splitToList() method | Guava | Java

Last Updated : 31 Jan, 2019
The method splitToList(CharSequence sequence) splits sequence into string components and returns them as an immutable list. Syntax:
public List<String> 
 splitToList(CharSequence sequence)
Parameters: This method takes sequence as parameter which is the sequence of characters to split. Return Value: This method returns an immutable list of the segments split from the parameter. Below examples illustrate the working of splitToList() method: Example 1:
Output:
Hello
 geeks
 for
 geeks
 noida
Example 2:
Output:
Everyone
 should
 Learn, Data
 Structures
Comment