Aryan PrajapatKnowledge Contributor
How do you convert character to ASCII code
How do you convert character to ASCII code
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Questions | Answers | Discussions | Knowledge sharing | Communities & more.
You can use the String.prototype.charCodeAt() method to convert string characters to ASCII numbers. For example, let’s find ASCII code for the first letter of ‘ABC’ string,
“ABC”.charCodeAt(0); // returns 65
Whereas String.fromCharCode() method converts numbers to equal ASCII characters.
String.fromCharCode(65, 66, 67); // returns ‘ABC’