标签:etl 页面 htm abc asc new meta function fun
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>第一个javascript计算页面</title>
</head>
<body>
<script type="text/javascript">
var s1="abc";
alert(typeof s1);
alert(s1.length);
var s2=new String("def");
alert(typeof s2);
alert(s2.length);
var ymd="2019-12-29".split("-");
for (var i=0;i<ymd.length;i++){
alert(ymd[i]);
}
/*String.prototype.getLength=function () {
return this.getLength();
}
var l1=s1.getLength();
alert(l1);
var l2=s2.getLength();
alert(l2);*/
alert("abcdf".charAt(0));//a
alert("sunyuhuan".substr(2,3));//nyu
alert("sunyuhuan".substring(2,3));//n
alert("sun-yuhuan".replace("-",‘,‘))
</script>
</html>
标签:etl 页面 htm abc asc new meta function fun
原文地址:https://www.cnblogs.com/god1/p/12114239.html