Joining, replacing, stripping: combining these with splitting and slicing amounts to the carpentry of working with strings in Python.


Joining, Replacing, Stripping

S = " Some text "
a = S.strip()
b = S.replace(' ','-')
c = S.replace(' ','')
R = S.split()
d = ':'.join(R)
e = ' and '.join(R)