ASCII in JS
Last updated
Last updated
This function returns the number code of a character on the ASCII table (JavaScript charCodeAt function Documentation).
string.charCodeAt( [index] )
index
(Optional): Index of string to get character and return its code number on the ASCII table. If this parameter is not specified, it takes 0 as default.
Int
.
CREATE OR REPLACE FUNCTION get_ascii(c char)
RETURNS string
LANGUAGE JAVASCRIPT
AS
$$
return C.charCodeAt();
$$;
SELECT GET_ASCII('A') A, GET_ASCII('a') a;