<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 sf = " This is TEST message ";
alert(sf.trim());
</script>
Thursday, June 5, 2008
String Trim() in Javascript
Subscribe to:
Comments (Atom)