0

For same string actionScript's function charCodeAt returns unicode character 13 and javascript's function charCodeAt returns unicode character 10. Is there a reason why a line feed is returned by JS and a carriage return is returned by AS. After reading a few answers online I have come to the conclusion that both of these do not have much difference, can anyone please explain why was this change made.

5
  • 2
    Are you sure it's the same string and hasn't been reformatted automatically? Maybe by the different text editor? Commented Nov 29, 2021 at 18:57
  • @skara9 Yes it is the same string I copy the string from the same excel sheet. Is there a major difference between line feed and carriage return? Commented Nov 29, 2021 at 20:01
  • 1
    The fact, that you copy the same text, does not mean it is not re-formatted when you paste in into... well, whatever you paste it into. Some editors treat CRLF as a single "new line" instruction, some use CR only, some even put two new lines for CRLF. Commented Nov 30, 2021 at 13:13
  • @arielBodyLotion What problem are you trying to solve by knowing this? Commented Dec 5, 2021 at 18:07
  • @VC.One I am just curious why the same text when converted using actionscript gives a different char and with javascript gives a different character and wanted to know why is this happening. Commented Dec 20, 2021 at 10:06

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.