Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript remove space from two side of string

const string = " this contains   spaces ";    
string.replace(/s{2,}/g, '').trim() 
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #remove #space #side #string
ADD COMMENT
Topic
Name
2+8 =