Category: Text function
This function returns the UTF-8 code (from 0 to 2047) of the first character of text.
Argument | Type | Description |
---|---|---|
text | Text | A text string from which the UTF-8 value of the first character is returned. |
Return value type: Number
Attempting to get the code of a character with UTF-8 code greater than 2047 will result in an "#Exotic character" error.
code('Z') //Returns 90
code(' ') //Returns 32 (Space character)
code('ABC') //Returns 65 (The ASCII code for the first character, 'A')