mRt*_*mRt 10 python regex string
我需要从字符串中替换非数字字符.
例如,"8-4545-225-144"需要为"84545225144"; "$ 334fdf890 == - "必须是"334890".
我怎样才能做到这一点?
Ign*_*ams 18
''.join(c for c in S if c.isdigit())
ken*_*ytm 17
正则表达式是可能的.
import re ... return re.sub(r'\D', '', theString)
归档时间:
15 年 前
查看次数:
7146 次
最近记录:
14 年,11 月 前