Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Javascript Trim

DZone's Guide to

Javascript Trim

·
Free Resource
Adds trim function to javascript string object.

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

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}