-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstring-method.html
40 lines (28 loc) · 923 Bytes
/
string-method.html
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
<!DOCTYPE html>
<html>
<head>
<title>Javascript String</title>
</head>
<body>
<script type="text/javascript">
// var greetings = "Hello! nice to see you again and again.";
// console.log(greetings.indexOf("again", 25));
// console.log(greetings.search("again"));
// console.log(greetings.slice(10,33));
// console.log(greetings.slice(-12));
// console.log(greetings.substring(5));
// console.log(greetings.replace("!", "~"));
// console.log(greetings.toLowerCase());
var task1 = "Do something now";
var task2 = "Buy something for me";
// console.log(task1 + " " + task2);
var tasks = task1.concat(". ", task2);
// console.log(tasks);
var inputValue = " Mg Mg ";
// console.log(inputValue.trim());
var userEmail = "[email protected]";
console.log(userEmail.charAt(4));
console.log(userEmail.charCodeAt(4));
</script>
</body>
</html>