Prev Demo
Substring() To Extract The Last Character In Javascript
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <head> <title>Demo</title> </head> <body> <h1>Extracting last character.</h1> <p>Click the below button to extract last character.</p> <input type="button" value="Extract" onclick="Function()" /> <p id="myId"></p> <script> function Function() { var A = "TechFunda"; var r = A.substring(8, 9); document.getElementById("myId").innerHTML = r; } </script> </body> </html>
Note: We DO NOT save your trial code in our database.
Output