How to remove all white spaces in a string in Python

Опубликовано: 14 Апрель 2026
на канале: Code with Renan
6,519
51

If you want to truly remove any space in a string, leaving only the characters, the best solution is to use a regular expression.

You can also read about it if you prefer on:
https://renanmf.com/remove-white-spac...


📚 Buy my book Python Fundamentals
https://renanmf.com/products/


📸Instagram:   / renanmouraf  
🌎 Website: https://renanmf.com/
🐦 Twitter:   / renanmouraf  
📝 LinkedIn:   / renanmouraf  

👍 Please leave a LIKE and SUBSCRIBE for more content! 👍



⭐️ Tags ⭐️
Python


#️⃣ Hashtags #️⃣
#Python