日期:2014-05-17 浏览次数:20888 次
string str = "123.123adc";
foreach (Match match in Regex.Matches(str, @"[0-9]+(\.[0-9]+)?
------解决方案--------------------
[a-zA-Z]+"))
Console.WriteLine(match.Value);
List<string> list = new List<string>() {
"123abc",
"123.123abc"
};
list = list.Select(a => {
Match m = Regex.Match(a,@"(?i)(\d+?(\.\d+)?)([a-z]+)");
return m.Groups[1].Value + " " + m.Groups[3].Value;
}).ToList();