给定一个字符串,将所有左双引号替换为两个反引号,并将所有右双引号替换为两个单引号。
左引号表示以引号开头的引号。右引号表示以引号结尾的引号。报价不能嵌套。您可能会假设字符串中双引号的数量为偶数。
例子
输入:
"To be or not to be," quoth the Bard, "that
is the question".
The programming contestant replied: "I must disagree.
To `C' or not to `C', that is The Question!"
输出:
``To be or not to be,'' quoth the Bard, ``that
is the question''.
The programming contestant replied: ``I must disagree.
To `C' or not to `C', that is The Question!''