首页 > 解决方案 > 过滤字符串并仅获取整数

问题描述

我正在使用 PYTHON3 我的输出是这样的“200:就在手边”我只需要 200 有没有办法删除字符串和符号?谢谢

标签: pythonstringfilter

解决方案


>>> txt = "200:Just be close at Hand"
>>> txt.split(":")[0]
'200'

推荐阅读