JavaScript String Method : charAt(index)

The charAt() method is used to extract the character from a given index. The syntax would be :
  string.charAt(index)
Example :
<html>
<body>
  <script>
    var mystr = "This is The test String.";
    document.write(mystr, "<br/>");
    document.write("Charactor at mystr[8] : ", mystr.charAt(8));
    document.write("<br/>")
    document.write("Charactor at mystr[17] : ", mystr.charAt(17));
  </script> 
</body>
</html>
Output :



Next Topic :