+ Start a Discussion
JTecJTec 

Ascii Representation in Apex

    Hi,

We need to obtain the ascii character of a number in a trigger. Something like chr(65) ===> A.
Is this posible in Apex language?

Thanks

 
boBNunnyboBNunny

You can do this by converting the character to Hex

   i.e. encodingUtil.convertToHex(blob.valueOf('A'))

Then you can bruteforce calculate the 2 characters.  So, if the character is 'A', then the Hex value would be 41 (4X16+1).