Javascript examples for String:charCodeAt
Return the Unicode of the last character in a string
<!DOCTYPE html> <html> <body> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {// w w w. ja v a 2 s .com var str = "HELLO WORLD"; var n = str.charCodeAt(str.length-1); document.getElementById("demo").innerHTML = n; } </script> </body> </html>