Java Script
--------------------------
<!DOCTYPE html>
<html>
<body>
<h2>JavaScript String Methods</h2>
<p>Using String.split():</p>
<p id="demo"></p>
<script>
let text = "Hello";
const myArr = text.split("");
text = "";
for (let i = 0; i < myArr.length; i++) {
text += myArr[i] + "<br>"
}
document.getElementById("demo").innerHTML = text;
</script>
</body>
</html>
=========
Result:
JavaScript String Methods
Using String.split():
H
e
l
l
o
No comments:
Post a Comment
Add your comment here.