-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstringmethods.js
More file actions
36 lines (33 loc) · 770 Bytes
/
Copy pathstringmethods.js
File metadata and controls
36 lines (33 loc) · 770 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
34
/*var name,index,last,sea;
name="hey he is good.But good is only a acting";
index=name.indexOf("good",18);
console.log(index);
last=name.lastIndexOf("good",15);
console.log(last);
sea=name.search("good");
console.log(sea);*/
var fruites,ext;
fruites="Apples, banana, kiwi";
/*ext=fruites.slice(8,14);
ext=fruites.slice(8);
ext=fruites.slice(-5,0);
console.log(ext);
*/
/*ext=fruites.substring(8,14);
console.log(ext);*/
/*ext=fruites.substr(2,4);
console.log(ext);*/
/*var name=" Hello world ";
var tr=name.trim();*/
var name="Hello World";
var sear,index;
sear=name.charCodeAt(4);
console.log(sear);
console.log(name[0])
var arr,i,text="";
arr=name.split("");
for(i=0;i<(arr.length);++i)
{
text=text+arr[i]+'\n';
}
console.log(text);