两个常用的函数

      :: Flash :: 2005-7-4 10:2
//arr:Array n:Array's length
function disorder(arr:Array,n:Number) {
    var i = 0;
    var temp;
    while (i<n) {
        var rnd = Math.floor(Math.random()*n);
        temp = arr[i];
        arr[i] = arr[rnd];
        arr[rnd] = temp;
        i++;
    }
    delete temp,i;
    return arr
}


//str:String s:String:that's you want to replace
function replace(str:String,s:String){
var temp=str.split(s);
str=temp.join("");
delete temp;
return str;
}
标签集:TAGS:
回复Comments() 点击Count()

回复Comments

{commentauthor}
{commentauthor}
{commenttime}
{commentnum}
{commentcontent}
作者:
{commentrecontent}