# Newline (\\n) confusion

**URL:** <https://forum.kirupa.com/t/newline-n-confusion/321524>\
**Category:** flash\
**Created:** [April 21, 2011, 9:01pm UTC](https://forum.kirupa.com/t/newline-n-confusion/321524 "2011-04-21T21:01:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tpann](https://avatars.discourse-cdn.com/v4/letter/t/c67d28/32.png) [@tpann](https://forum.kirupa.com/u/tpann)\
**Post date:** [April 21, 2011, 9:01pm UTC](https://forum.kirupa.com/t/newline-n-confusion/321524/1 "2011-04-21T21:01:18Z")

</div>

Hello all,

I’m wondering why there is a behavior difference where a newline character (  
) is involved, between a string:String and a string represented by textField.text. To wit:

var str:String = “Hello  
world”;  
trace(str.charAt(5) == "  
"); // true

var tf:TextField = new TextField();  
tf.text = str;  
trace(tf.text.charAt(5) == "  
"); // false

Why is the newline character recognized in the “string” and not in the “.text”?
