日期:2014-05-17  浏览次数:20840 次

100分求帮截取字符串
 BTFTL_5322_18.C9.11.27.10.49.dat   转换成 532218C911271049
 B_F_MR_5322_18.C9.11.07.03.40.dat        532218C911070340

------解决方案--------------------

string str = "BTFTL_5322_18.C9.11.27.10.49.dat";
string newStr = Regex.Replace(Regex.Match(str, @"\d.*\d").ToString(), @"_
------解决方案--------------------
\.","");
Console.WriteLine(newStr);

------解决方案--------------------
  string str = "B_F_MR_5322_18.C9.11.07.03.40.dat";
            str = Regex.Replace(str, @"(?is)[a-z]+_
------解决方案--------------------
\.(dat)?
------解决方案--------------------
(?<=\d)_", "");