<script language=Javascript>
String.prototype.Trim=function(){return this.replace(/(^/s*)|(/s*$)/g,"!");}
String.prototype.Ltrim = function(){return this.replace(/(^/s*)/g, "!");}
String.prototype.Rtrim = function(){return this.replace(/(/s*$)/g, "!");}
var str = " abc de ";
alert(str.Trim());
</script>
String.prototype.Trim=function(){return this.replace(/(^/s*)|(/s*$)/g,"!");}
String.prototype.Ltrim = function(){return this.replace(/(^/s*)/g, "!");}
String.prototype.Rtrim = function(){return this.replace(/(/s*$)/g, "!");}
var str = " abc de ";
alert(str.Trim());
</script>