In javascript there is a function codePointAt which returns A number representing the code point value of the character at the given index. Is there a UDF or built in function similar to codePointAt function?
var icons = '☃★♲';
console.log(icons.codePointAt(0));
// expected output: "9733"
It's asc() in ColdFusion. The function only converts a single (the first) character though, so you have to extract the position of the desired character in a string by yourself, using mid() for example.
<cfscript>
icons = '☃★♲';
icon = mid(icons, 2, 1);
writeOutput( asc(icon) );
// expected output: "9733"
</cfscript>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With