-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjs2.html
22 lines (22 loc) · 813 Bytes
/
js2.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport"content="width=device-width,initial-scale=1.0">
<meta http-equiv="X-UA-Compatible"content="ie-edge">
<title>javascript string functions</title>
</head>
<body>
<script>
str="is tHIS string ";
console.log("index of desired char is "+ str.indexOf('r'));
console.log("last index of desired char is "+ str.lastIndexOf('is'));
console.log(str.replace('string','harry'));
console.log(str.toUpperCase());
console.log(str.toLowerCase());
console.log(str.concat(' new one'))
console.log(str.trim());
console.log(str.charAt(5));
</script>
</body>
</html>