请问如何提取一个字符串中的某些内容并保存到数组中 你这是字符川还是本身从xml文档中取值呢 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 你试一下这个:str = System.Text.RegularExpressions.Regex.Replace(str, "<[^<>]*>", " ", System.Text.RegularExpressions.RegexOptions.IgnoreCase);str = System.Text.RegularExpressions.Regex.Replace(str, "\s+", " ", System.Text.RegularExpressions.RegexOptions.IgnoreCase);string [] sa = str.Split(" ".ToCharArray()); Regex weatherRegex=new Regex(@"(?<=<td[^>]*?>)(?<content>.*?)(?=</td>)",RegexOptions.None);string weather="<td width=54 rowspan=1 >北京</td> <td height=25>北京</td> <td>雷阵雨</td> <td> ≤3</td> <td>25 ℃</td> <td>阴</td> <td> ≤3</td> <td>32 ℃</td>";MatchCollection weatherMatches=weatherRegex.Matches(weather);foreach(Match weatherMatch in weatherMatches){ GroupCollection weatherGroups=weatherMatch.Groups; Console.WriteLine(weatherGroups["content"].Value);} 把以<开始 >结束的字符串都删掉就得到了 如何连接并控制远程计算机并获取远程计算机的临时文件夹路径? c# word二次开发 出现的二级目录不能对齐的问题 帮看下 这么写对不 超简单 请问一个HTML的问题 弱弱的问一下`昵称在哪里改 - -别删我贴啊``我的结贴率现在好低 在DataTable里如何设置过滤去除重复行 急~卡住了,大家来帮我看看啊 c#程序员交流的天堂QQ:群14354766 读取一个文件目录的问题? 子窗口1调整大小,如何使子窗口2相应调整? datagrid选取某一行时,如何通过点击按钮获取这一行中所有列的值? 问一个说简单不简单,说复杂也绝对不复杂的困饶我很久的问题:)
string weather="<td width=54 rowspan=1 >北京</td> <td height=25>北京</td> <td>雷阵雨</td> <td> ≤3</td> <td>25 ℃</td> <td>阴</td> <td> ≤3</td> <td>32 ℃</td>";
MatchCollection weatherMatches=weatherRegex.Matches(weather);
foreach(Match weatherMatch in weatherMatches)
{
GroupCollection weatherGroups=weatherMatch.Groups;
Console.WriteLine(weatherGroups["content"].Value);
}