这里是我的问题:在一个变量,文本和包含逗号,我尝试删除只设两个字符串(事实上之间的逗号[和]).例如,使用以下字符串:
input = "The sun shines, that's fine [not, for, everyone] and if it rains, it Will Be better."
output = "The sun shines, that's fine [not for everyone] and if it rains, it Will Be better."
Run Code Online (Sandbox Code Playgroud)
我知道如何使用.replace整个变量,但我不能为它的一部分做.这个网站上有一些主题正在接近,但我没有设法利用它们来解决我自己的问题,例如: