×
Home About Us Products Services News Free Scripts Contact
news php scripts and software

JavaScript & DHTML example - How to get a character on a specified position in a string?


JavaScript & DHTML - How to get a character on a specified position in a string?

You may use the charAt method of the String object
 For example to get the last caracter of a string:
 
<script>

var yourString="WHATEVER";
 
alert(yourString.charAt(yourString.length - 1));
 
</script>

Category: JavaScript & DHTML

 
<< Go back