char2Num Function

Converts a character in a string to the ASCII value of the character.


int char2Num(str text, int position)

Parameter

Description

text

The string that contains the character.

position

The position of the character in the string.

The ASCII value of the character as an int object.

  • char2Num("ABCDEFG",3); //Returns the numeric value of C, which is 67.

  • char2Num("ABCDEFG",1); //Returns the numeric value of A, which is 65.

Community Additions

ADD
Show: