<script> var any = 'mystring'; any = str.slice(0, -1); //g will be remove from mystring to (mystrin). //i hope you understand. </script>