标签:
var str ="abc"; var str = new String("abc"); var str = String("abc');
<html> <head> <script typt="text/javascript"> var str="abcdefghi"; alert(str);//abcdefghi alert(str.charAt(0));//a var str1="aaa"; var str2="bb"; var str3="cc"; alert(str1.concat(str1,str2,str3));//abbcc alert(str1.indexOf("a",0)); alert(str.replace("a","lll")); var arr = str.split(""); for(var i=0;i<arr.length;i++){alert(": "+arr[i]);} </script> </head> <body> </body> </html>
var str="abcdefghi"; alert(str.substr(0,2));//ab alert(str.substr(1,3));//bcd alert(str.toUpperCase());//ABCDEFGI alert(str.toLowerCase());//abcdefgi
版权声明:本文为博主原创文章,未经博主允许不得转载。
标签:
原文地址:http://blog.csdn.net/zl18603543572/article/details/46953657