function asciiToHex(ch: string) {
// Get the ASCII value of the character
const asciiValue: number = ch.charCodeAt(0);
// Convert the ASCII value to a hexadecimal string
const hexValue: string = asciiValue.toString(16);
return hexValue;
}
const ch: string = 'A';
const hex_value: string = asciiToHex(ch);
console.log("The hexadecimal value of '" + ch + "' is 0x" + hex_value);
/*
run:
"The hexadecimal value of 'A' is 0x41"
*/