I want to remove all the whitespace between the numbers in a string in python. For example, if I have
my_string = "my phone number is 12 345 6789"
I want it to become
my_string = "my phone number is 123456789"
I thought I could do this for every number:
for i in range(10):
my_string = my_string.replace(str(i)+" ",str(i))
But this isn't a smart and efficient solution. Any thoughts?