"will jQuery add it in the future" that doesn't really make sense, as it's a String object thing, not really a jQuery object thing
and it's super easy to add with one single line String.prototype.trim = function() { return this.replace(/^\s+|\s+$/g, ''); }; bam var s = " i am string with whitespace "; s.trim() >>>>> "i am a string with whitespace" James wrote: > jQuery does have a trim function: > http://docs.jquery.com/Utilities/jQuery.trim > Although it's not in the syntax of "string".trim(). > > return jQuery != MooTools; > > On Apr 1, 5:46 pm, yifang <xiaoyifang198...@gmail.com> wrote: > > mootools support syntax like this "string".trim() > > will jquery support such features in the future? > > thanks.