How to do validation of multiple blank spaces in JavaScript?

I want to do multiple blank spaces validation in JavaScript. so kindly suggest me the logic.

11/22/2017 10:41:04 AM

Santosh Nagargoje

2 Answers

New Answer


count = stringToCheck.search(/\s/); This will return the number of spaces. then use an if/else to check if it is greater than 1 or 2 or whatever you want. This is a simple Google-question ;)


thanks a lot frnd