I have three lists, that I have merged into one list
static List allLists = Stream.of(list1, list2, list3)
.flatMap(Collection::stream)
.collect(Collectors.toList());
I have user input without whitespaces
String = "HelloIwanttobookanonlineseminaratyourcompany"
All the words in the user input String are already in allLists. I want to iterare over allLists and insert whitespaces into the String, with every word found. The result should be:
String = "Hello I want to book an online seminar at your company"
Is there an easy solution I miss?