Java – Split List<String> into… sublist?

By | October 30, 2018
Questions:

I’m really not sure how to best ask this, so hopefully someone can figure out what I’m talking about.

Assume a List that looks something like this:

[
    "Harum beatae autem occaecati. Incidunt quis",
    "eius perferendis itaque dolorum dolores doloribus.",
    "Veniam voluptate mollitia\net aut qui magnam. Ut",
    "quos unde nulla qui. Earum odit dolores non illo illum."
]

I want to split it at the “\n” like so :

[
    "Harum beatae autem occaecati. Incidunt quis",
    "eius perferendis itaque dolorum dolores doloribus.",
    "Veniam voluptate mollitia",
    "et aut qui magnam. Ut",
    "quos unde nulla qui. Earum odit dolores non illo illum."
]
Answers:

Leave a Reply

Your email address will not be published. Required fields are marked *