我有一个非常吵的弦输入 我试图清理它..
所以,这段吵闹的弦的一部分 可能是:
"big $price chair, 5x10"
Now removing symbols and other stuff are done! But I also want to remove
5x10
为了这个,我做了这个:
def remove_numerics(self,string):
return .join([term for term in string.split() if not term[0].isdigit()])
解决了这个案子
但如果我的绳子是:
"big $price chair, x10"
Then it fails? what is a good pythonic way to solve this case also. many thanks.