Python: Remove numbers at the beginning of a string
问题 I have some strings like this: string1 = "123.123.This is a string some other numbers" string2 = "1. This is a string some numbers" string3 = "12-3-12.This is a string 123" string4 = "123-12This is a string 1234" I need to remove these numbers from the beginning of the string. I tried strip[start: end] method but because of the irregular format of the string I cant use it? any suggestions? 回答1: You can remove all digits, dots, dashes and spaces from the start using str.lstrip(): string1