-
Notifications
You must be signed in to change notification settings - Fork 0
/
16.html
35 lines (32 loc) · 1.23 KB
/
16.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
<!DOCTYPE html>
<html lang="en">
<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>Document</title>
</head>
<body>
<script type="text/javascript">
var str="Hello world!"
//document.write(str.charAt(1))
var txt="Hello world!"
//document.write(txt.anchor("myanchor"))
//console.log(txt.charAt);
// javascript对应的底层采用的是c语言实现的底层的操作的。
var str1="good";
var str2="baby";
//console.log(str1.concat(str2));
var str="Hello world!"
//document.write(str.indexOf("Hello") + "<br />")
//document.write(str.indexOf("World") + "<br />")
// document.write(str.indexOf("world"))
// javascript对应的是不存在replaceall的相关的操作的。replaceall的相关的操作可以如下执行
var str="Hello world Hello";
while(str.indexOf("Hello")!=-1){
str=str.replace("Hello","star");
}
console.log(str);
</script>
</body>
</html>