<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<script>
// 声明字符串
let str1 ='周万芳nb';
let str2 ='周万芳nb';
let str3 ='周万芳nb';
// 判断一个字符串在不在某个字符串里面
let index1 =str1.indexOf('江软');
console.log(index1);
let str4 = str1.substr(2,3)
console.log(str4);
let str5 = str1.replace('江软','二班')
console.log(str5);
console.log('ABCD'.toLowerCase());
console.log('abcd'.toUpperCase());
console.log('中文不存在大小写'.toLowerCase);
//小练习
let str = '星期天,星期一,星期二,星期三,星期四,星期五,星期六';
let today = new Date();
console.log(today);
let day = today.getDay();
console.log(day);//3
let arr = str.split(',')
console.log(arr);
console.log("今天是;"+arr[day]);
let str11 = "I am "+
"dangerous";
console.log(str11);
let str22 ="I am\
dangerous";
console.log(str22);
let str33=
`I
am
dangerous`;
console.log(str33);
//定义变量
let name=`万方`;
let skill =`爆炸`;
//字符串中嵌入变量
document.write(`${name}就是${skill}`)
</script>
</body>
</html>