pr5 Rohit
pr5 Rohit
document.write("str1 = "+str1+"</br>");
document.write("str2 = "+str2+"</br>");
document.write("str3 = "+str3+"</br>");
document.write("str4 = "+str4+"</br>"+"</br>");
document.write("1) Concatination using (+) operator = "+(str1+str2)+"</br>");
document.write("2) CharAt Method ="+(str1.charAt(3))+"</br>");
document.write("3) IndexOf Method ="+str2.indexof("h")+"</br>");
document.write("4) lastindexof Method ="+str4.lastIndexOf("i")+"</br>");
document.write("5) Search Method ="+str4.search("Engineering")+"</br>");
document.write("6) split Method ="+str1.split("")+"</br>");
document.write("7) SubString Method ="+str2.substring(2,6)+"</br>");
document.write("8)SubStr Method ="+str2.substr(2,6)+"</br>");
</script>
</body>
<body>
<h1 style ="font-size:25px;color:blue;">Convert String to Numbers and Numbers to
Strings</h1>
<script>
var s1 = "6";
var s2 = "8.55";
var s3 = "JavaScript";
var i = 25;
document.write("Result 1 ="+parseInt(s1)+"</br>");
document.write("Result 1 ="+parseFloat(s2)+"</br>");
document.write("string ="+i.toString()+"</br>");
document.write("Result 1 ="+str1.toUpperCase()+"</br>");
document.write(" Result 2 ="+str1.toLowerCase()+"</br>");
</script>
</body>
</html>
Output :-