HEADER ADS 728X90

JavaScript String Method Tutorial Part-03 | Javascript Tutorial:37 | BY CodePrime

Abdullah sheikh,css,html,php,javascript,tutorial,code prime,javascript string method,javascript string methods,javascript string method replace,javascript crash course,concat(),split(),repeat(),slice(),substring(),toString,javascript tutorial,javascript for beginners,javascript tutorial for beginners,javascript tutorial in hindi,programing tutorial in amharic,programing tutorial in bangla,programming for beginners,how to learn programming,js full course,codeprime, coding tutorial, how to learn coding easy way to learn coding

Hi dear welcome to "CodePrime" Blog . In this post you are going to learn JavaScript String Method Tutorial Part-03 | Javascript Tutorial:37 | BY CodePrime . First Creat A index.html file Copy This HTML CODE and pest it one your code editor. 2ndly creat string-method-3.js file Then Copy The JS CODE and pest it then open the index.html file with your browser.

HTML CODE

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Javascript tutorial by codeprim</title>
    <script src="js/string-methods-3.js"></script>
</head>
<body>
    <br>
    <br>
    <br>
    <h2 style="padding:10px 20px;background:#000;color: #fff;">Javascript tutorial by codeprime</h2>
   
</body>
</html>

JAVASCRIPT CODE


//concat
var a = str.concat(" " + str2," " +  str3);
var str = "Javascript is a great language";
var str2 = "hello"
var str3 = "world"

//split
var str = "Javascript is a 2 great language 2023";
var a = str.split("2");
document.write(a);


//Repeat
var str = "Javascript is a great language";
var a = str.repeat(5)
document.write(a);


// //Slice
var str = "Javascript is a great language";
var a = str.slice(5, 10)
document.write(a);

// //substr
var str = "Javascript is a great language";
var a = str.substr(0, -1, 2,5)//any paramiter(positive or negetive)
document.write(a);

// //substring
var str = "Javascript is a great language";
var a = str.substring(0, -1, 2,5)//only positive paramiter
document.write(a);


//toString
var str = 50;
var a = str.toString();
document.write(a + 20);

//valueOf
var str = "Javascript is a great language";
var a = str.valueOf();
document.write(a);


Youtube Tutorial

FLOW US ON SOCIAL MEDIA

Post a Comment

0 Comments

Join Telegram