日期:2014-05-17 浏览次数:21084 次
public static IList<int> GetNumberic(string str)
{
IList<int> numbericList=new List<int>();
MatchCollection ms = Regex.Matches(str, @"\d+");
foreach(Match m in ms)
{
numbericList.Add(m.Value);
}
return numbericList;
}
public static IList<string> GetStrings(string str)
{
IList<string> strList=new List<string>();
MatchCollection ms = Regex.Matches(str, @"\D+");
foreach(Match m in ms)
{
strList.Add(m.Value);
}
return strList;
}