Answers for "how to remove the blank space in python"

3

python remove spaces

string=' t e s t ' 
print(string.replace(' ',''))
Posted by: Guest on October-14-2020
0

python remove spaces

#If you want to remove LEADING and ENDING spaces, use str.strip():

sentence = ' hello  apple'
sentence.strip()
>>> 'hello  apple'
Posted by: Guest on July-20-2021

Code answers related to "how to remove the blank space in python"

Python Answers by Framework

Browse Popular Code Answers by Language