Need help on solving below usecase using Java where in the below paragraph
A@123@456789@10111213
B@123@456789
C@123@456789@101112131415
D@123@456789
E@123@456789@101112131415161718
has to be changed to this way below
A@123@4567
89@1011121
3
B@123@4567
89
C@123@4567
89@1011121
31415
D@123@4567
89
E@123@4567
89@1011121
3141516171
8
meaning each line in the given paragraph is checked for a certain length in this case 10 , and if it exceeds a newline has to be added. This behavior has to be applied on every line in the paragraph
Any help ?