I want to send a string made of a big number of similar lines (around 30 lines, it's variable). This message is too long to be sent in one message, so I used to send it in a .txt file. But I figured out I'd rather have it sent in several messages
Is there an efficient way to split a string, given a separator string, such that it actually splits it every n separators and not each separator ?
For example, if the separator is '.' and n=3, the string 'ab.c.def.g.h.ijklm.nop.qrst' would be split as ['ab.c.def', 'g.h.ijklm', 'nop.qrst']
Then I'd like to apply it with separator '\n' because I want to split the string every 10 lines.