\n = linux \r = mac (prior to macos being based on freebsd I guess) \r\n = the damned pc linefeed.
The TextField object in Flash seems to render both \r and \n as linefeeds. Therefore I was getting way too many linefeeds in my rendered text.
Tada! _text is of type String. The /g is VERY important at the end of the declaration of the RegExp, it means it will replace ALL instances. If you do not put /g it wont.
- var pcLB:RegExp = /
- var macLB:RegExp = /\r/g;
- var linuxLB:RegExp = /\n/g;
- text = _text.replace(pcLB, "\n");
- text = _text.replace(macLB, "\n");
CommentsSubscribe to comments
You need to login to post a comment.