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 ) );
Written by Ion D. Filho
Related protips
1 Response

Also, with linq
int[] intArray = stringArray.Select(x=> int.Parse(x)).ToArray();
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#.net
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#