Version: v0.7.0 - Beta.  We welcome contributors & feedback.


getCharCode($index = 1) -> string


Get the ASCII value of the character at $index.

If $index is negative, it counts from the end of the string.

If the index is outside the bounds of the string, it will return -1. (Note: It would be simpler if it returned 0, but that is the ASCII code for NULL).

This is the opposite of String.charFromCode.

//= 97

//= 99 (code for 'c')

//= 102 (code for 'f')

//= -1

See Also