string strTemp = "123456公里";
char[] cStr = new Char[]{'0','1','2','3','4','5','6','7','8','9'};
MessageBox.Show(strTemp.Substring(0,strTemp.LastIndexOfAny(cStr)+1));

解决方案 »

  1.   

    很容易,如果不是我理解错了:char里有很多Is...,找到第一个是LETTER的位置就行了,然后截取。
      

  2.   


     as follows:   using System.Text.RegularExpressions;  //正则表达式
       ......   string st="123456公里";   Match ma=Regex.Match(st,@"[0-9]+");
       if(ma.Success)
       { 
    str=ma.Value;   //str="123456"
       } 如果要汉字:
         
       string st="123456公里";   Match ma=Regex.Match(st,@"[\u4e00-\u9fa5]+");
       if(ma.Success)
       { 
    str=ma.Value;   //str="公里"
       }