让我们说:
a = r''' Example
This is a very annoying string
that takes up multiple lines
and h@s a// kind{s} of stupid symbols in it
ok String'''
Run Code Online (Sandbox Code Playgroud)
我需要一种方法在"This"和"ok"之间进行替换(或者只是删除)和文本,这样当我调用它时,现在等于:
a = "Example String"
Run Code Online (Sandbox Code Playgroud)
我找不到任何似乎有效的通配符.任何帮助深表感谢.
python ×1