final var msg = "Hello "
+ System.lineSeparator()
+ " my name is"
+ System.lineSeparator()
+ " "
+ System.lineSeparator()
+ "Jimmy";
final List<String> lines = msg.lines()
.filter(s -> !s.isBlank())
.map(String::strip)
.toList();
System.out.println(lines);