小编San*_*nya的帖子

如何替换接下来的三个字符?

如果模式包含字符“ ai”或“ hi”,请用* \ *替换接下来的三个字符

string = """
Or help one fainting robin
Unto his nest again,
I shall not live in vain
"""
Run Code Online (Sandbox Code Playgroud)

输出应为:

或再一次帮助一位知更鸟

让我再也无法幸免,我将不会徒劳。

python string replace python-3.x

-1
推荐指数
1
解决办法
304
查看次数

标签 统计

python ×1

python-3.x ×1

replace ×1

string ×1