Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

remove empty space from string python

string = "Welcome to Python"
new_str = "".join(string.split(" "))
print(new_str) # "WelcometoPython"
Comment

python remove blanks from string

sentence = ' hello  apple  '
sentence.strip()
>>> 'hello  apple'
Comment

PREVIOUS NEXT
Code Example
Python :: convert plt image to numpy 
Python :: python how to show package version 
Python :: python merge list of lists 
Python :: pd.merge remove duplicate columns 
Python :: how to slice a string in python 
Python :: python variable declare 
Python :: index from multiindex pandas 
Python :: how to add a value to a list in python 
Python :: tree to tuple python 
Python :: replace list python 
Python :: zip multiple lists 
Python :: bulk create django 
Python :: planets code 
Python :: python if string contains substring 
Python :: Upper letter list 
Python :: python imaplib send email 
Python :: start a django project 
Python :: ffill python 
Python :: python uppercase 
Python :: numpy random for string 
Python :: json and python login system 
Python :: python example 
Python :: how to check a phone number is valid in python 
Python :: combine two columns pandas 
Python :: python check phone number 
Python :: python math operators 
Python :: resample ohlc pandas 
Python :: how to run fastapi with code python 
Python :: A value is trying to be set on a copy of a slice from a DataFrame. Try using .loc[row_indexer,col_indexer] = value instead 
Python :: how to make a game in python 
ADD CONTENT
Topic
Content
Source link
Name
2+3 =