js复习之--String对像

来源:互联网 发布:nt数据看胎儿性别 编辑:程序博客网 时间:2024/05/31 18:30
        var str = "asd我ADGSE我~爱.北京";        window.document.write(str.length + "<br/>");        window.document.write(str.charAt(1) + "<br/>");        window.document.write(str.indexOf("d我", 0) + "<br/>");        window.document.write(str.lastIndexOf("家", 2) + "<br/>");        window.document.write(str.split(/~|\./) + "<br/>");        window.document.write(str.substr(0, 2) + "<br/>");        window.document.write(str.substring(0, 3) + "<br/>");        window.document.write(str.toLowerCase() + "<br/>");        window.document.write(str.toUpperCase() + "<br/>");

方法描述FFIEanchor()创建 HTML 锚。13big()用大号字体显示字符串。13blink()显示闪动字符串。1 bold()使用粗体显示字符串。13charAt()返回在指定位置的字符。13charCodeAt()返回在指定的位置的字符的 Unicode 编码。14concat()连接字符串。14fixed()以打字机文本显示字符串。13fontcolor()使用指定的颜色来显示字符串。13fontsize()使用指定的尺寸来显示字符串。13fromCharCode()从字符编码创建一个字符串。14indexOf()检索字符串。13italics()使用斜体显示字符串。13lastIndexOf()从后向前搜索字符串。13link()将字符串显示为链接。13localeCompare()用本地特定的顺序来比较两个字符串。14match()找到一个或多个正则表达式的匹配。14replace()替换与正则表达式匹配的子串。14search()检索与正则表达式相匹配的值。14slice()提取字符串的片断,并在新的字符串中返回被提取的部分。14small()使用小字号来显示字符串。13split()把字符串分割为字符串数组。14strike()使用删除线来显示字符串。13sub()把字符串显示为下标。13substr()从起始索引号提取字符串中指定数目的字符。14substring()提取字符串中两个指定的索引号之间的字符。13sup()把字符串显示为上标。13toLocaleLowerCase()把字符串转换为小写。--toLocaleUpperCase()把字符串转换为大写。--toLowerCase()把字符串转换为小写。13toUpperCase()把字符串转换为大写。13toSource()代表对象的源代码。1-toString()返回字符串。--valueOf()返回某个字符串对象的原始值。14
原创粉丝点击