If I understand correctly, the problem you seek to solve is, if you have the string "123abc456", to get the string "123"?
If so, you could try the regular expression split:
Code:
var Parts = System.Text.RegularExpressions.Regex.Split("123abc456", "[^0-9]+");
This would return an array of strings containing the strings "123" and "456". Get the first element (if Parts.Length > 0, otherwise do something else).

If you simply want to remove everything except numeric characters, use replace:
Code:
var Result = System.Text.RegularExpressions.Regex.Replace("123abc456", "[^0-9]+", "");
This would return "123456".