I usually try to create, general-purpose, re-usable, "small" code-tools in situations like this:
private static Regex GetInt = new Regex(@"\d+");
private bool StringToInt32(string str, ref int result)
{
return Int32.TryParse(GetInt.Match(str).Value, out result);
}