0

I'm trying to do this:

  ArticleTitle = ArticleTitle.Replace(" - ", "—");

To get a — to appear in front of the text. It doesn't work. And it appeared — What should I be doing here?

4

1 回答 1

4

使用嵌入在字符串文字中的实际 Unicode 字符(根据正常的 C# 源代码规则) - 并让 XML API 处理它需要执行的任何转义或编码:

ArticleTitle = ArticleTitle.Replace(" - ", "\u8212");
于 2013-02-17T09:30:00.110 回答