Unwanted spaces to remove in string in js

by Prabakaran 2012-07-30 17:01:30

<script type="text/javascript">

String.prototype.trim = function() {
return this.replace(/^s+|s+$/g, "");
};



var s=" Hiox India ";alert(s.length)
var str=s.trim();
alert(str.length);
</script>
770
like
0
dislike
0
mail
flag

You must LOGIN to add comments