C# 正则表达式替换的问题,

var formatString = "{a}xxxx{b}xxx{c}xxx{d}xxx{e}xxx";
Dictionary<string, string> dic = new Dictionary<string, string>
{
  { "a","xxxx" },
  { "b","xxx" },
  { "c","x" },
  { "e","xxxxxx" },
  { "d","xxxxxxx" },
};

如上:

  如何使用dic中的值去替换formatString {\w+} 字符串呢

有木有大神知道, 请指点感激不尽


HUX布斯
浏览 738回答 2
2回答
打开App,查看更多内容
随时随地看视频慕课网APP