c# - How convert a row in csv to array of double? -


i have following data:

1,1,1,1,1,1

i want read line , covert array of ints or other type.

is there 1 line solution that?

var arr = "1,1,1,1,1,1".split(',').select(s => int.parse(s)).toarray(); 

in case text includes spaces

var arr = regex.matches("1,1,1,1,1,1", @"\d+")                     .cast<match>()                     .select(m => m.value)                     .toarray(); 

Comments

Popular posts from this blog

c - Calling a function within a loop -

vb.net - Unbound DataGridView add row with checkbox error -

How i fill combobox items in Radgridview manually using in vb.net -