How to remove trailing spaces from string in Node.js

1 Answer

0 votes
let str = 'javascript,typescript,node.js,python         ';
 
str = str.trimEnd();
 
console.log("'" + str + "'");
 
   
   
   
   
/*
run:
   
'javascript,typescript,node.js,python'
   
*/

 



answered Jun 9, 2022 by avibootz

Related questions

1 answer 193 views
1 answer 209 views
2 answers 288 views
3 answers 336 views
1 answer 231 views
...