# renove all single character for text
text = "t is a c test for removing multiple spaces"
document =' '.join( [w for w in text.split() if len(w)>1] )
print(document)
This version removes all single chars, and spaces with one space, we have regex version too.
0 Comments