<html lang="ko">
<head>
<meta charset="UTF-8">
<title>JavaScript String Method</title>
</head>
<body>
<h1>문자열 추출</h1>
<script>
var str = "abcDEFabc";
document.write(str.slice(2, 6) + "<br>"); // cDEF
document.write(str.slice(-4, -2) + "<br>"); // Fa
document.write(str.slice(2) + "<br>"); // cDEFabc
document.write(str.substring(2, 6) + "<br>"); // cDEF
document.write(str.substr(2, 4)); // cDEF
</script>
</body>
</html>