C# How to replace Microsoft's Smart Quotes with straight quotation marks?

后端 未结 12 1423
花落未央
花落未央 2020-12-08 00:50

My post below asked what the curly quotation marks were and why my app wouldn\'t work with them, my question now is how can I replace them when my program comes across them,

12条回答
  •  南方客
    南方客 (楼主)
    2020-12-08 01:42

    According to the Character Map application that comes with Windows, the Unicode values for the curly quotes are 0x201c and 0x201d. Replace those values with the straight quote 0x0022, and you should be good to go.

    String.Replace(0x201c, '"');
    String.Replace(0x201d, '"');
    

提交回复
热议问题