Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove   if there are more than 10

I want to allow only a maximum of 10   between any two words and remove the remaining  . How can I do this in JavaScript with a regex?

like image 671
user1906529 Avatar asked Dec 20 '25 13:12

user1906529


1 Answers

str.replace(/\ {11,}/g, "          ");
like image 192
Can Berk Güder Avatar answered Dec 22 '25 01:12

Can Berk Güder



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!