Sort:  

@pilcrow Great. Upvoted with 100 %. Can you retry doing this using recursion? That way we can just pass the delimiters and the level, the program should break it upto nth level.

The delimiter changes each time, so recursion doesn't seem like a good option to me. In fact, the only difference between a paragraph, a line and a word is which delimiter it uses. If I did this recursively I can't think of a way to reliably break up the content into increasingly smaller chunks.

By the way, is this a contest or your homework I'm solving? ;)

I already have used this in https://steemit.com/languages/@gokulnk/learning-german-using-google-spreadsheets

I wanted to know if there was a better way of doing this. Hence posted this as a contest.