【发布时间】:2016-03-16 01:33:27
【问题描述】:
我有一些这样的字符串:
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"
我需要从字符串的开头删除这些数字。我尝试了strip[start: end] 方法,但由于字符串格式不规则,我无法使用它?有什么建议?
【问题讨论】:
-
应该去掉标点吗?
-
在删除了数字和标点符号之后,空格会发生什么?也许您可以在您的问题中添加一些预期的输出?
标签: python regex string string-split