Saturday, January 21, 2017

Replace Multiple Characters in a String At Once with Python

s = "MARCH - ANN"
Want to remove whitespace and -

s1 = s.replace(" ", "").replace("-", "")

No comments:

Post a Comment