How Split string using regular expression in java
public class RegEX {
public static void main(String[] args) {
String pattern = "([\\s+])";
String test="Have Nice Day ";
for(String token : test.split(pattern))
System.out.println(token);
}
}
======================================
Result :
Have
Nice
Day
======================================