Thanks monkey! I was aware of your module, but hadn't taken a closer look at it since I already had my own linebreak code. Now I'll definitely check out how you've set up the String array returns.
My problem was that I wanted to write a linebreaker that returned the first part of the broken String and updated the original String to only contain the remaining text, but as it turned out you can't change the String that the function was called on. This way I could simply return an String[2] array containing both Strings (I'm not interested in breaking the entire String at once because line length may change between lines, and the calling function needs to parse some html like tags that influence the rendering and text width).
Once again, thanks for pointing me in the right direction!
My problem was that I wanted to write a linebreaker that returned the first part of the broken String and updated the original String to only contain the remaining text, but as it turned out you can't change the String that the function was called on. This way I could simply return an String[2] array containing both Strings (I'm not interested in breaking the entire String at once because line length may change between lines, and the calling function needs to parse some html like tags that influence the rendering and text width).
Once again, thanks for pointing me in the right direction!