Yeah, you can easily do it with a flatmap. Here is...
# announcements
b
Yeah, you can easily do it with a flatmap. Here is an example where the split is on
P
and you have 2 lines and 4 paragraphs
Copy code
val lines = listOf("8198Pwhys", "kfjslkjfdlskPnfjdsnfjds")
lines.flatMap { it.split("P") }
[8198, whys, kfjslkjfdlsk, nfjdsnfjds]