Is there a reason why the string will not be equal to itself? I process a large number of lines, and some lines, after all, are not aligned.
Here is an image that shows what I'm talking about.

Any ideas?
RESOLVED: There is a carriage return (\ r) attached to the end of one of the lines. I used String.length to view the lengths of each string, and they were different (5 and 6). Then I looked at the string using String.charAt. In Chrome, this showed an empty string (""). However, the empty string was not false. I tried this in FireFox and it showed a carriage return.
javascript string
H khan
source share