jquery trim last ‘N’ characters

Below the example to trim last two characters.

<script>
var content_string = 'RAMP IT';
var content_string_name = content_string.slice(0, -2); //=>  slice(0, -N) - update N based on your need.
alert(content_string_name);
</script>

Leave a Reply

Your email address will not be published. Required fields are marked *