BIG阳
我决定只使用单引号,并用双引号替换它们。 var s = "He said 'Hello' to me";
s = s.Replace("'","\"");这有点烦人,因为我需要粘贴这样的东西 {"children":[{"domid":"sbsmStatusFilter","datatitle":"SBS Status","dataicon":"img/appicons/rsm4-64x64.png"},{"domid":"sbsMonitoringFilters","datatitle":"Monitoring","dataicon":"img/appicons/monitoring64x64.png"}]}然后使用文本编辑器查找替换函数将所有双引号替换为单引号,然后添加文本替换代码,我最终将其转换为此 var text3 = @"{'children':[{'domid':'sbsmStatusFilter','datatitle':'SBS Status','dataicon':'img/appicons/rsm4-64x64.png'},{'domid':'sbsMonitoringFilters','datatitle':'Monitoring','dataicon':'img/appicons/monitoring64x64.png'}]}";
text3 = text3.Replace("'", "\"");我想还不错。至少文本相当容易阅读,因此人们可以修改它。