An Interest In:
Web News this Week
- April 21, 2024
- April 20, 2024
- April 19, 2024
- April 18, 2024
- April 17, 2024
- April 16, 2024
- April 15, 2024
January 11, 2023 06:53 pm GMT
Original Link: https://dev.to/capeladev/4-different-ways-of-removing-spaces-from-a-string-29kg
4 different ways of removing spaces from a string
4 different ways of removing spaces from a string, sorted by cleanliness.
The replaceAll()
method was introduced in ES2021 and I feel it is still underused because many still dont know about its existence. The last 2 are for educational purposes, they work but we should prefer the replaceAll()
or replace()
methods for this type of operation.
If you have any topic that you would like me to cover please leave a comment. And, remember to have fun playing with JS!
Thanks! Hopefully it was useful! For more short-format content on JavaScript like this, follow on Instagram or Twitter!
Original Link: https://dev.to/capeladev/4-different-ways-of-removing-spaces-from-a-string-29kg
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To