-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJsStringMathod.js
More file actions
63 lines (48 loc) · 1.32 KB
/
Copy pathJsStringMathod.js
File metadata and controls
63 lines (48 loc) · 1.32 KB
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
function myString(){
str1='Shubham Harendra Ankit';
return("the string is :"+str1);
}
function myLength(){
let str1='Shubham Harendra Ankit';
return ("the string lenth is:"+str1.length);
}
function mySlice0(){
str1='Shubham Harendra Ankit';
return ("the slice of string is :"+str1.slice(7,16));
}
function mySlice1(){
str1='Shubham Harendra Ankit';
return ("the string reverse slice is :"+str1.slice(-14,-5));
}
function mySlice2(){
str1='Shubham Harendra Ankit';
return ("the slice is from index 0 is : "+str1.slice(0));
}
function mySlice3(){
str1='Shubham Harendra Ankit';
return ("the slice is from index 7 is : "+str1.slice(0));
}
function mySlice4(){
str1='Shubham Harendra Ankit';
return ("the slice is from index 16 is : "+str1.slice(16));
}
function mySlice5(){
str1='Shubham Harendra Ankit';
return ("the slice is from index -16 is : "+str1.slice(-14));
}
function mySubstring(){
str1='Shubham Harendra Ankit';
return str1.substr(8,9);
}
function mySubstring1(){
str1='Shubham Harendra Ankit';
return str1.substr(7);
}
function mySubstring2(){
str1='Shubham Harendra Ankit';
return str1.substr(-6);
}
function myReplace1() {
let text1="this is harendra!";
let newText=text1.replace("harendra" , "Harry") ;
}