How to get the value of a character in ColdFusion

Asc() - get the value of a character

Asc.cfm


<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Asc function example: how to get the value of a character</title>
</head>

<body>
<h2 style="color:hotpink">Asc Function Example</h2>

<table style="color:LightGreen; background:Green;" border="1" bordercolor="DarkGreen">
    <tr>
     <td style="font-weight:bold">Asc[Character]</td>
     <td style="font-weight:bold">Output[Value]</td>
    </tr>
    <tr>
     <td>#Asc("a")#</td>
     <td><cfoutput>#Asc("a")#</cfoutput></td>
    </tr>
    <tr>
     <td>#Asc("A")#</td>
     <td><cfoutput>#Asc("A")#</cfoutput></td>
    </tr>
    <tr>
     <td>#Asc("B")#</td>
     <td><cfoutput>#Asc("B")#</cfoutput></td>
    </tr>
    <tr>
     <td>#Asc("b")#</td>
     <td><cfoutput>#Asc("b")#</cfoutput></td>
    </tr>
    <tr>
     <td>#Asc("X")#</td>
     <td><cfoutput>#Asc("X")#</cfoutput></td>
    </tr>
    <tr>
     <td>#Asc("y")#</td>
     <td><cfoutput>#Asc("y")#</cfoutput></td>
    </tr>
    <tr>
     <td>#Asc("s")#</td>
     <td><cfoutput>#Asc("s")#</cfoutput></td>
    </tr>
    <tr>
     <td>#Asc("H")#</td>
     <td><cfoutput>#Asc("H")#</cfoutput></td>
    </tr>
</table>

</body>
</html>


More ColdFusion examples