标签: python python-3.x
我有一个变量,需要用单词匹配替换它。
目前这是我的逻辑
string = "This is a test" x = string.replace("Test", "")
我如何确保此处的大写T可以匹配整个单词以进行测试?