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
Post a Comment