x
 
1
<!DOCTYPE html>
2
<html>
3
<body>
4
5
<h1>JavaScript String substring()</h1>
6
<script>
7
    var str = "Learn To Code For Free";
8
    document.write(str.substring(6, 12));
9
</script>
10
11
</body>
12
</html>