<img src="http://www.oa7t.com/syssite/home/shop/1/images/defaultpic_big.gif" width="190" height="190" border="0" alt="真彩-0.5/106.7史努比圆珠笔芯" />
我需要把类似这样的代码中的 alt="真彩-0.5/106.7史努比圆珠笔芯"
这一句过滤掉.请高手指教
參考答案:只会C#,可以参考:
建议先取出这一句,再从原句中把这句替换为空.这样简单多了,
用正则表达式: alt="[^>]*"
using System.Text.RegularExpressions;
string s="<img src........alt="真彩-0.5/106.7史努比圆珠笔芯" /> "
string pattern = "alt=\"[^<]*\"";
Regex rgx = new Regex(pattern);
s= rgx.Replace(s,"");