function trim (str) {
        str = this != window? this : str;
        return str.replace(/^\s+/, '').replace(/\s+$/, '');
    }
  
    // Test
    if(trim("    \t   \n   test  ram \r\n   \t \t\n"== "test  ram"alert("Yes");

Add new attachment

Only authorized users are allowed to upload new attachments.
« This page (revision-1) was last changed on 06-Apr-2006 09:45 by 이동국  
G’day (anonymous guest) My Prefs

Referenced by
OpenSources

JSPWiki v2.8.4