Java Stream create from Regex

Description

Java Stream create from Regex


import java.util.regex.Pattern;

public class Main {
  public static void main(String[] args) {
    String str = "XML,CSS,HTML,SQL,Java,Javascript"; 
    Pattern.compile(",")
    .splitAsStream(str)/*from www.  java  2s .  c om*/
    .forEach(System.out::println);

  }
}



PreviousNext

Related