Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
12-04-2012, 06:13 AM #1
- Join Date
- Dec 2012
- Thanked 0 Times in 0 Posts
Question regarding charCodeat for conversion
I looked around and he said that I should do something like this:
var str = new String( "This is string" );
document.write("str.charCodeAt(0) is:" + str.charCodeAt(0));
document.write("<br />str.charCodeAt(1) is:" + str.charCodeAt(1));
document.write("<br />str.charCodeAt(2) is:" + str.charCodeAt(2));
document.write("<br />str.charCodeAt(3) is:" + str.charCodeAt(3));
document.write("<br />str.charCodeAt(4) is:" + str.charCodeAt(4));
document.write("<br />str.charCodeAt(5) is:" + str.charCodeAt(5));
12-04-2012, 08:48 AM #2
- Join Date
- Jun 2002
- London, England
- Thanked 2,508 Times in 2,486 Posts
No need to be over-elaborate.
or (preferred) var arrName = ;
BTW, when posting here please help us to help you by following the posting guidelines and wrapping your code in CODE tags. This means use the octothorpe or # button on the toolbar. You can (and should) edit your previous post.
"In the beginner's mind there are many possibilities, but in the expert's mind there are few” - Shunryu Suzuki (Japanese Zen priest, ?-1971)
Last edited by Philip M; 12-04-2012 at 09:02 AM.
All the code given in this post has been tested and is intended to address the question asked.
Unless stated otherwise it is not just a demonstration.