PDA

Click to See Complete Forum and Search --> : asc() and chr() in JavaScript


Sneeden
Jan 26th, 2004, 01:11 PM
are there equivalent statements in JavaScript to VB's asc() and chr()?

Travis G
Jan 26th, 2004, 02:36 PM
I'm just guessing, double check the documentation (links in my sig).

String.charCodeAt(index)
String.fromCharCode(num1, num2,...)

CornedBee
Jan 26th, 2004, 02:37 PM
Strings have charCodeAt, which is like asc, and fromCharCode, which is like chr.

CornedBee
Jan 26th, 2004, 02:37 PM
Travis was faster, but unlike him I already checked the docs ;)

Travis G
Jan 26th, 2004, 02:40 PM
Originally posted by CornedBee
Travis was faster, but unlike him I already checked the docs ;)

Yeah, sorry. I just checked them, too. I'm looking for a refresh. But I found out that these are Unicode values and not ASCII values. Shouldn't be a problem, but it depends on what you want to use them for.

Sneeden
Jan 26th, 2004, 05:34 PM
thanks guys. I appreciate it.