参考代码:
string str = "100万-1000万"; var matches = Regex.Matches(str, @"(\d+)"); foreach (var match in matches) { Console.WriteLine(match); }
.net 的环境中怎么个搞法呢?
@iisp: 这个代码就是纯正的C#代码
@dudu:
string str = "100万-1000万";
MatchCollection matches = Regex.Matches(str, @"(\d+)");
foreach (string match in matches)
{
Console.WriteLine(match);
}
报错,输出有误啊……
string str = "100万-1000万";
MatchCollection matches = Regex.Matches(str, @"(\d+)");
foreach (Match match in matches)
{
Console.WriteLine(match);
}
Console.ReadKey();
match不是string类型