Fri, 17 May 2024


How to get a character on a specified position in a string?

By: Peter, NetArt Media
Sun, 6 June 2021

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
Share this post:



See All Scripts






Subscribe for our newsletter

Receive the latest blog posts direct in your mailbox