ASCII
Description
The ASCII function is used to obtain the ASCII code value or Unicode code point of a specified character (chr). If the input character length is greater than 1, the function will only return the ASCII code value or Unicode code point of the first character.
Parameter Description
- chr: Type is string, representing the character for which the ASCII code value or Unicode code point needs to be queried.
Return Result
- Returns an integer (int), representing the ASCII code value or Unicode code point of the input character.
Usage Example
- Query the ASCII code value or Unicode code point of a single character:
- Query the ASCII values or Unicode code points of multiple characters:
- Query the ASCII code value or Unicode code point of special characters:
- Query the ASCII code value or Unicode code point of an empty character:
Notes
- When the input character length is 1, the ASCII function will return the ASCII code value or Unicode code point of that character.
- When the input character length is greater than 1, the ASCII function will only return the ASCII code value or Unicode code point of the first character.
- For non-ASCII characters (such as Chinese characters), the ASCII function will return the corresponding Unicode code point.