标签:for 部分 之间 找不到 匹配 方法 markdown ice www
var str = "1sdffd";
var str2 = str.substring(0,3);
//console.log(str2); //1sd
var str = "werasdf";
//console.log(str.indexOf("w")) //0
//console.log(str.indexOf("e")) //1
//console.log(str.indexOf("k")) //-1
var str = "wersdf";
var arr = [];
for( var i=0;i<str.length;i++ ){
//console.log( str.charAt(i) ) //wersdf
}
for( var i in str ){
//console.log(str) //wersdf
if( arr.indexOf(str) == -1 ){
arr.push(str);
}
}
//console.log(arr); //[wersdf]
var str = "wertt";
//console.log( str.slice(0,2) ); //we
var str = "2?d?d?sdf?d";
var arr = str.split("?");
//console.log(arr); //["2","d","d","sdf","d"]
var str = "www";
//console.log(str.replace("w","r") ); //rww
var str = "wwWW";
//console.log(str.replace( /w/ig,"r")) //rrrr
标签:for 部分 之间 找不到 匹配 方法 markdown ice www
原文地址:http://www.cnblogs.com/lhh-bky/p/7992897.html