title: C# methood to scrape a line into an array - does not pass the array on return
body: <p>i am quite new to C# and i have been doing my progress via projects with goals i`m trying to achieve.</p>
  
  <p>i am stuck in something rather general and simple, and it will assist me to understand and move forward.</p>
  
  <pre><code>public Array ExtractRakeFromHand(string theline)
      {
          int rri = 0;
  
  
          var rakeandpot = theline.Split().Where(x =&gt; x.StartsWith("("))
                   .Select(x =&gt; x.Replace("(", string.Empty).Replace(")", string.Empty))
                   .ToList();
          var playerssplit = theline.Substring(theline.IndexOf("ers ("));
          var pbreakdown = playerssplit.Substring(theline.IndexOf("("));
          pbreakdown = pbreakdown.Remove(pbreakdown.Length - 1, 1);
          var numofplayers = pbreakdown.Split(',');
          (string player, double player_portion, double potsize, double rakesize, string hand)[] myar = new (string player, double player_portion, double potsize, double rakesize, string hand)[numofplayers.Length];
          for (int iii = 0; iii &lt; myar.Length; iii++)
          {
              myar[iii].rakesize = Double.Parse(rakeandpot[0]);
              myar[iii].potsize = Double.Parse(rakeandpot[1]);
          }
  
          var values = pbreakdown.Split(',');
          (string name, double value)[] result = new (string, double)[values.Length];
          for (int ii = 0; ii &lt; values.Length; ii++)
          {
              var splittedValue = values[ii].Split(':');
              result[ii] = (splittedValue[0], Double.Parse(splittedValue[1], CultureInfo.InvariantCulture));
              myar[rri].player = result[rri].name;
  
              var ppot = (result[rri].value / myar[rri].potsize);
              var ppotr = ppot * myar[rri].rakesize;
              myar[rri].player_portion = ppotr;
              rri++;
          }
  
          return myar;
      }
  </code></pre>
  
  <p>i call this method via  var thedata = ExtractRakeFromHand(d);</p>
  
  <p>the return is an object that does not contain the "Name" and "Rake" fields. </p>
  
  <p>how can i make it return the array in the same way it was created ?</p>
  
  <p>I tried to add this class:</p>
  
  <pre><code> public class RakeHandParse
      {
          public string player { get; set; }
          public double player_portion { get; set; }
          public double potsize { get; set; }
          public double rakesize { get; set; }
          public string hand { get; set; }
  
      }
  </code></pre>
  
  <p>but i`m not sure how to use it inside the code to get back the full details.</p>
  
  <p>thanks so much !</p>