Okay, this post is a year old, but I would love to know the same thing... how can you determine where line breaks / newlines are in a textArea string?
If I have a text document with line breaks, those line breaks are represented okay when I paste the text into the textArea... and they even show up when I trace(textArea.text) -- the newlines correctly break the line and return for a new line.
But I see no line break / newline codes anywhere. How can we detect/split the string at a new line?
You need to look for windows style carriage returns as well
yeah, since I'm testing on Windows I managed to get it to work by searching for \r\n, but will want to change it to be flexible for either case as you pointed out.
The tricky thing for me was forcing line breaks to occur after storing the input (in XML file) and entering it back into a display container (in my case, using FlowLayout group in which each word is a separate label)...
but I got it figured out (by storing space code in XML then using this to insert empty spacer labels to fill the difference)