Aaron Li's Blog

Write it down before I forget

  Home  |   Contact  |   Syndication    |   Login
  30 Posts | 0 Stories | 21 Comments | 1 Trackbacks

News

Google

Archives

Other's Idea

Wednesday, September 05, 2007 #

add this single line into Javascript portion,

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

then test with

var mystring="test   ";
alert(mystring.trim());