Javascript Data Type How to - Remove the first letter from a String








Question

We would like to know how to remove the first letter from a String.

Answer


<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'>
window.onload=function(){<!--   w w  w  . j a v  a2 s  .c o m-->
    var input = "#stringexample";
    input = input.substring(1);
    document.writeln(input);
}
</script>
</head>
<body>
</body>
</html>

The code above is rendered as follows: