Here is the extension method. This is done on string, because you can't add a static function to a string.
public static int[] ToIntArray(this string value)
{
return value.Split(',')
.Select<string, int>(s => int.Parse(s))
.ToArray<int>();
}
Here is how you use it
string testValue = "123, 456,789";
int[] testArray = testValue.ToIntArray();
This assumes you want to split on ',' if not then you have to change the ToIntArray