-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path07_stringPartTwo.js
126 lines (87 loc) · 2.79 KB
/
07_stringPartTwo.js
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
//Replacing string content
// 1] replace()
// let myName = "yadnyesh"
// let myNewName = myName.replace("nyesh", "u")
// console.log(myNewName);
// let text = "Please Microsoft visit Microsoft!";
// let newText = text.replace(/microsoft/ig, "SCOE");
// console.log(newText)
// let text1 = "Please Microsoft visit Microsoft!";
// let newText1 = text1.replaceAll("Microsoft", "SCOE");
// console.log(newText1)
//upperCase to lowerCase and lowerCasee to upperCase
// let str1 = "yadnyesh"
// let str1ToLowerCase = str1.toLowerCase()
// console.log(str1ToLowerCase);
//concat
// text1 = "Hello"
// text2 = "world"
// text3 = text1.concat( text2)
// console.log(text3);
//trim
// let videoLenght = " 35min "
// // console.log(videoLenght)
// let trimedVideo = videoLenght.trimEnd()
// console.log(trimedVideo)
// //String charAt()
// let text = "HELLO WORLD";
// let char = text.charAt(3);
// console.log(char)
// // charCodeAt UTF-16 code return karta hain unicode transformation format
// let text1 = "HELLO WORLD";
// let char1 = text1.charCodeAt(3);
// console.log(char1)
//Property access []
// let str1 = "yadnyesh"
// console.log(str1[2])
// // str1[2] = 'z'
// // console.log(str1)
// let str1 = "apple,banana,mango"
// let str1Array = str1.split(",")
// console.log(str1Array)
// let myname = "yadnyesh"
// console.log(myname.toUpperCase())
//Replacing string content
// 1] replace()
// let myName = "yadnyesh"
// let myModifiedName = myName.replace("nyesh", "u") //yadu
// console.log(myModifiedName)
// let fruits = "apple,banana,mango"
// let newFruits = fruits.replace("BANANA", "kiwi") //case sensitive
// // console.log(newFruits);
// const newString = "Hey there morning! Good morning"
// // const anotherString = newString.replace(/morning/g, "afternoon")
// // console.log(anotherString);
// const anotherString = newString.replaceAll("morning", "afternoon")
// console.log(anotherString);
//uppercase and lowercase
// let anyStrnig = "NARAYAN"
// console.log(anyStrnig.toLowerCase())
// //concat()
// let str1 = "Good"
// let str2 = "Morning"
// const str3 = str1.concat(" good ",str2)
// console.log(str3);
//trim()
// let randomString = " tanvi "
// console.log(randomString);
// let convertedString = randomString.trimEnd()
// console.log(convertedString);
//Extracting string characters
// 1] charAt
// let str1 = "suyash"
// let str2 = str1.charAt(2) //y
// console.log(str2);
//charCodeAt() // 16-utf code
// let newString = "yadnyesh"
// console.log(newString.charCodeAt(0))
//property access
// let newString = "manas"
// console.log(newString[1])
// newString[1]="y"
// console.log(newString)
// //split()
// let fruits = "apple, banana, mango, kiwi"
// let newFruitsArray = fruits.split(",")
// console.log(newFruitsArray);
// console.log(newFruitsArray[0])