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

yii2 - Yii 2 Running a Cron in the basic template -

asp.net - 'System.Web.HttpContext' does not contain a definition for 'GetOwinContext' Mystery -

mercurial graft feature, can it copy? -