<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 = " sdf ";
alert(str.Trim());
alert(str.Ltrim());
alert(str.Rtrim());
</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 = " sdf ";
alert(str.Trim());
alert(str.Ltrim());
alert(str.Rtrim());
</script>