python - 如何将特定数字替换为单词?
问题描述
如果有输入:
"My phone number is 123780936407, and there are two 0 in it."
我希望输出是:
"My phone number is 123780936407, and there are two zero in it."
但是,如果我使用替换,输出将是:
"My phone number is 12378zero9364zero7, and there are two zero in it."
我该怎么做才能获得理想的输出?非常感谢!
解决方案
推荐阅读
- xamarin.ios - 通过 URL 方案将数据从一个应用程序传递到另一个应用程序?
- python - 索引超出范围,同时尝试在 Python 中创建字典
- python - 如何使用 sqlite3 在 python 中为我的两种用户类型提供单独的菜单
- python - 在不更改批量大小的情况下,ai 引擎上的内存不足
- swift - 在 Swift 中使用 Core Graphics 填充多边形
- arrays - 在 mongodb 的数组字段上更新或替换 []
- istio - Istio queryParams 总是返回真值
- delphi - BitmapListAnimation - 如何跳转到选定的帧
- javascript - 当我通过它的 ID 调用它时,为什么我没有得到它的内容?
- scala - Spark 中毫秒格式的正确时间戳