Last Updated: February 25, 2016
·
7.552K
· iondrimba

Convert string array to int array - 3 steps!

char[] delimiters = new char[] { ',' };
string[] stringArray = "1,2,3,4,5".Split( delimiters );
int[] intArray = Array.ConvertAll( stringArray, s => int.Parse( s ) );

1 Response
Add your response

Also, with linq

int[] intArray = stringArray.Select(x=> int.Parse(x)).ToArray();

over 1 year ago ·