<script>
function String.prototype.left(n){//自定义left函数
return this.substring(0,n)
}
alert("1234567".left(2))
alert("1234567".left(4))
</script>
function String.prototype.left(n){//自定义left函数
return this.substring(0,n)
}
alert("1234567".left(2))
alert("1234567".left(4))
</script>
function String.prototype.left(n){//自定义left函数
return this.substring(0,parseInt(n))
}
alert("1234567".left("2"))
alert("1234567".left("4"))
alert("123456".substring(0,parseInt("2")))
</script>
left(a,b)
b是字符,不是数字
-----------------------------------------------------------------------------
欺负我不会vb??
我怎么不知道vb中的left还能这么用?