javascript trim的实现
<script type="text/javascript">String.prototype.trim = function(){ return this.replace(/(?:^\s*)|(?:\s*$)/g,'');}var test = ' liuuxiosbo ';alert(test.trim().length);</script>