Check out this blog post:
http://weblogs.asp.net/sushilasb/archive/2006/08/03/How-to-extract-numbers-from-string.aspx
A simple program that extracts the number from the String using a regular expression.
class Program
{
static void Main(string[] args)
{
Console.WriteLine(ExtractNumbers("( 01 - ABCDEFG )")); // 01
Console.ReadLine();
}
static string ExtractNumbers(string expr)
{
return string.Join(null, System.Text.RegularExpressions.Regex.Split(expr, "[^\\d]"));
}
}
Hope this helps!