[Javascript] Trim whitespaces using Replace function

Christopher J. Baldoza baldoza at colibria.com
Mon Jul 9 00:15:24 CDT 2001


Hi,
      
     I see the ff expression.
 
    STRING=STRING.replace(/^[\s]+/g,"");
    STRING=STRING.replace(/[\s]+$/g,"");

     I know that these are expressions to trim the 
white spaces but I want to know what is the 
meaning of each characters inside the replace 
function.
     
     Thanks in Advance.

Thope    




More information about the Javascript mailing list