in javascript, get the last character in a string - Javascript jQuery

Javascript examples for jQuery:String

Description

in javascript, get the last character in a string

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript" src="https://code.jquery.com/jquery-1.6.3.js"></script> 
      <script type="text/javascript">
    $(function(){/*from   w w  w .  ja  v a2 s .co m*/
 var myString = "Test3";
console.log(myString[myString.length-1])
    });

      </script> 
   </head> 
   <body>  
   </body>
</html>

Related Tutorials