function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ 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).