-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathString.html
More file actions
33 lines (32 loc) · 1014 Bytes
/
Copy pathString.html
File metadata and controls
33 lines (32 loc) · 1014 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script>
var str=' Hello world ';
console.log(str.length);
console.log(str.charAt(3));
console.log(str.charCodeAt(2));
console.log(str.indexOf('o'));
console.log(String.fromCharCode(97));
console.log(str.lastIndexOf('o'));
console.log(str.replace("l","c"));
console.log(str.slice(2,6));
console.log(str.slice(2,5));
console.log(str.substring(2,7));
console.log(str.substr(2,3));
console.log(str.split("e"));
console.log(str.toLowerCase());
console.log(str.toUpperCase());
console.log(str.trim());
console.log(str.match(/o/g));
console.log(str.concat('a','b','c'));
console.log('abc'.padStart(7));
console.log('abc'.padEnd(1));
</script>
</head>
<body>
</body>
</html>