title: using LINQ to find the cumulative sum of an array of numbers in C#
body: <p>I have a csv string containing doubles (e.g "0.3,0.4,0.3"), and I want to be able to output a double array containing the cumulative sum of these numbers (e.g [0.3,0.7,1.0]).</p>
  
  <p>So far, I have </p>
  
  <p><code>double[] probabilities = textBox_f.Text.Split(new char[]{','}).Select(s =&gt; double.Parse(s)).ToArray();</code></p>
  
  <p>which gives the numbers as an array, but not the cumulative sum of the numbers.</p>
  
  <p>Is there any way to continue this expression to get what I want, or do I need to use iteration to create a new array from the array I already have?</p>