Here is my input
....ALPO..LAPOL.STRING
I want to seperate each string when it reaches '.' and store in string array list.
I tried using the below code,
ArrayList<String> words = new ArrayList<> (Arrays.asList(chars.stream().map(String::valueOf)
.collect(Collectors.joining("")).split("\\.+")));
There is a problem with regex split("\.+")) .
EXPECTED OUTPUT:
ALPO
LAPOL
STRING
ACTUAL OUTPUT:
" " - > Blank Space
LAPOL
STRING
It prints the first value of the list as an empty value because there are many '.' present before 'A". How to get rid of this empty value in string array list. Any help would be glad !!
....ALPO..LAPOL.STRINGstring?