Use the slice() method to get substring - Javascript String

Javascript examples for String:Quiz

Description

Use the slice() method to get substring

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

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

<script>
var str = "this is a test test";
document.getElementById("demo").innerHTML = str.slice(6);
</script>/*  ww  w .  jav  a  2 s .  co m*/

</body>
</html>

Related Tutorials