js中string math,date对象

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">html

<html xmlns="http://www.w3.org/1999/xhtml">dom

<head>ui

<title>String对象</title>spa

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />xml

<meta name="description" content="布尔教育 http://www.itbool.com" />htm

<script>对象

var str="helloworld";ip

var  str1="hello";utf-8

document.write(str.concat(str1));字符串

document.write(str.indexOf(str1)); //若是没有,返回-1

var dt=new Date();

document.write(dt.getFullYear());

document.write(Math.floor(2.3));

alert(Math.random()*5+5);//5-10的随机数

</script>


</head>

    <body>

     String 对象的方法length

     str.concat链接两个字符串

     str.indexOf查找字符串出现的位置

     str.sbustr截取字符串

str.toLowerCase 都转化为小写 toUpperCase 转大写

     Date对象

     getFullYear 获取年

Math对象

Array对象等

    </body>

</html>

相关文章
相关标签/搜索