我想替换字符串中的单引号。这不包括开始和结束单引号。例如:
输入:这是输入的几个示例
myString = "'O'Nel'"
myString = "'OR'Nel, Dan' "
myString = "'OA'Nel'Test, John; random's t'est'"
输出这就是我想要的结果
myString = "'O''Nel'"
myString = "'OR''Nel, Dan' "
myString = "'OA''Nel''Test, John; random''s t''est'"
到目前为止我尝试过的。这段代码将替换开始和结束单引号,这是我不想要的。我想保持代码简单,也许有一个内置函数
myString = myString.Replace("'","''")
output myString = "''O''Nel''"