-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathString.js
More file actions
39 lines (25 loc) · 825 Bytes
/
String.js
File metadata and controls
39 lines (25 loc) · 825 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// String Concatenation
let firstName = " AdiTya "
let lastName = "Rawat"
let fullName = firstName + lastName;
console.log(fullName);
// ----------------------
// 1️⃣ Concatenation
let fullName = firstName + lastName.concat(" The GOAT")
console.log(fullName);
// 2️⃣ Append
// firstName += " going to BANARAS"
// console.log(firstName)
// 3️⃣ length
// console.log(firstName.length)
// 4️⃣ Cases
// console.log(firstName.toUpperCase())
// console.log(firstName.toLowerCase())
// 5️⃣ Slice
// console.log(firstName.slice(1,4))
// 6️⃣ Split & join
// console.log(firstName.split(" ").join("-"))
// 7️⃣ includes
// console.log(firstName.includes("T"))
// 8️⃣ Trim
// console.log(firstName.trim()) // to clear the spaces