Posted By

mcarneiro on 02/19/10


Tagged

regexp


Versions (?)

Trim


 / Published in: JavaScript
 

regular expression to trim the beginning and the end of a string.

  1. " teste 123 ".replace(/^(?:\s|)+(.*?)(?:\s|)+$/, '$1');

Report this snippet  

You need to login to post a comment.