1.提取字符串中所有数字字符
1 // convert text to int ignoring all non-numerical characters 2 public string str; 3 str = (new Regex("[^0-9]")).Replace(str, "");