SOURCE

var a="Weccome";

document.write(a.toLocaleLowerCase()+"</br>");

document.write(a.toLocaleUpperCase()+"</br>");

document.write(a.length+"</br>");

document.write(a.charAt(1)+"</br>");

document.write(a.substring(3)+"</br>");

document.write(a.substring(0,2)+"</br>");

var b="We to my home, and home";

document.write(b.replace("We","You")+"</br>");

document.write(b.replace(/home/g,"myhome")+"</br>");

document.write(b.split(" ")+"</br>");

document.write(b.split("")+"</br>");

document.write(b.split(", ")+"</br>");

document.write(b.indexOf("home")+"</br>");

document.write(b.lastIndexOf("home")+"</br>");

function ContChar(stringValue,a){
    
    var b=0;
    var char=stringValue.toLocaleLowerCase();
    for(var num=0;num<char.length;num++){
        
        //stringValue.charAt(num);
        if(char.charAt(num)==a){
            b=b+1;
        }
        
    }
    return b;
}
var h=ContChar("ccccc","c");

document.write(h+"</br>");

function countNumber(stringtoCount) {

    var numCount = 0;

     for(var i=0;i<stringtoCount.length;i++){
         if(stringtoCount.charAt(i)!=" "){
             if(isNaN(stringtoCount.charAt(i))==false){
             numCount++;
            }
        }         
    }
    return numCount;
}

document.write("该字符串数字有"+countNumber("dasdasd123 ewv2 4231 23dd")+"个"+"</br>");

function AbccbA(stringAbc) {
     var cbA;
     var stringcbA;
     for(var i=stringAbc.length;i>=0;i--){
         stringcbA=stringAbc.charAt(i);
         cbA.concat(stringAbc);
    }
    return cbA
}

document.write(AbccbA("sdadsd")+"</br>");







console 命令行工具 X clear

                    
>
console