Extract from position 3, and to the end: - Javascript String

Javascript examples for String:slice

Description

Extract from position 3, and to the end:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<button onclick="myFunction()">Test</button>

<p id="demo"></p>

<script>
function myFunction() {// w ww  .  ja  v a 2 s . co  m
    var str = "Hello world!";
    var res = str.slice(3);
    document.getElementById("demo").innerHTML = res;
}
</script>

</body>
</html>

Related Tutorials