Javascript Trim string

var trimmed = str.replace(/^\s+|\s+$/g, '') ;

that's all.

1 nhận xét:

Kale Co Jakim on December 11, 2017 at 10:00 PM said...

Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here. Kindly keep blogging. If anyone wants to become a Front end developer learn from Javascript Training in Chennai . or Javascript Training in Chennai. Nowadays JavaScript has tons of job opportunities on various vertical industry. ES6 Training in Chennai


Coding experience share Copyright © 2010 | Designed by Ipietoon for Free Blogger Template