I need to know how to separate, in line breaks, one string to each N character. However, before separating each N characters, they have already been separated by each comma .
I want this separation to be a break in the output.
Only the comma is very simple, just a split(",").join("\n")
that already solves. But a separation within another separation I can not. I even think of some solutions but all very large, and for my code I need something simple.
For example, one separation every 6 characters:
Entry:
teste,testando,outro teste
Output:
teste
testan
do
outro
teste