-
Notifications
You must be signed in to change notification settings - Fork 0
/
stringprop.html
54 lines (33 loc) · 1020 Bytes
/
stringprop.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title></title>
</head>
<body>
<!--
toUpperCase() -It is used to convert string in to uppercase letters.
toLowerCase() -It is used to convert string in to lowercase letters.
trim() -It is deprecated from js.
-It is used to remove the srting and ending whitespace.
repeat(count) - It is used to repeat any string multiple no. of time.
slice(beginIndex,endIndex) - It is used to take a part of string for ex- if string = "Welcome Himanshu" then
String.slice(8,15) is give the only "Himanshu" in return.
-->
<script type="text/javascript">
function abc() {
var a="abcdefg";
var b="ABCD"
document.write(a.toUpperCase()+"<br>");
document.write(b.toLowerCase()+"<br>");
document.write(a.repeat(3)+"<br>");
document.write(a.slice(0,4));
if (b.includes("C")) {
alert("b contains C");
}
}
abc();
</script>
</body>
</html>