skip to main | skip to sidebar

Coding Tips and Tricks

My Coding tips and tricks. Java, ASP.NET, C#, HTML, JavaScript, C++, C, JSP, Ajax and much more...

JavaScript trim()

String.prototype.trim = function () {
return this.replace(/^\s*(\S*(\s+\S+)*)\s*$/, "$1");
};

//
written by Douglas Crockford
at Wednesday, May 16, 2007 Labels: Crockford, Douglas, javascript, trim

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

About Me

Cagri Balkesen
Ph.D. student at ETH Zurich.
View my complete profile

Search This Blog

Blog Archive

  • ►  2008 (1)
    • ►  March (1)
  • ▼  2007 (9)
    • ►  June (2)
    • ▼  May (7)
      • Java XML parsing notes
      • Debugging a running program in GDB
      • ASP.NET parameters in web.config
      • JavaScript trim()
      • ASP.NET CultureInfo Turkish
      • JavaScript delete confirmation
      • Html Turkish Character Encoding