1//Java program to show the use of Split method (Java 8 and above)
2public class SplitString{
3
4 public static void main(String[] args)
5 {
6 //Initialize the String which needs to be split
7 String str = "Enlighter";
8
9 //Use the Split method and store the array of Strings returned in a String array.
10 String[] arr = str.split("");
11
12 //Printing the characters using for-each loop
13 for(String character : arr)
14 System.out.print(char);