C# Web,正则表达式去除html的空格

希望有一段完整的代码,谢谢大神,就两三行。
就是去除掉&nasp;

第1个回答  推荐于2016-09-05
using System;
using System.Text.RegularExpressions; 

namespace App{

class Program{

static void Main(string[] args){

string source = "<div>&nbsp</div> \r\n <a>&nbsp&nbsp</a>";
//除掉&nbsp
Console.WriteLine(Regex.Replace(source,@"&nbsp",""));

}
}
}

本回答被提问者和网友采纳
相似回答