[Tutor] Remove a number from a string
byron at christianfreebies.com
Tue Aug 23 22:03:11 CEST 2005
Shitiz Bansal wrote:
> Suppose i have a string '347 liverpool street'.
> I want to remove all the numbers coming at the starting of the string.
> I can think of a few ways but whats the cleanest way to do it?
Here's a function that can do what you're wanting to accomplish:
text = addr.split()
revisedAddr = ""
for item in text:
i = int(item)
revisedAddr += item + " "
# Test the function... ;-)
address = "5291 E. 24rd Ave."
More information about the Tutor